[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

eric.carlson at apple.com eric.carlson at apple.com
Thu Oct 29 20:45:41 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 7a5b80fa7052eb0bb6d7b71bb48a8a287901e163
Author: eric.carlson at apple.com <eric.carlson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 15 21:11:53 2009 +0000

    2009-10-15  Eric Carlson  <eric.carlson at apple.com>
    
            Reviewed by Adele Peterson.
    
            <rdar://problem/7306052> Fullscreen max/min volume buttons non-functional
    
            * WebView/WebVideoFullscreenHUDWindowController.mm:
            (-[WebVideoFullscreenHUDWindowController windowDidLoad]): Set volume buttons target and action.
            (-[WebVideoFullscreenHUDWindowController decrementVolume:]): New, decrement the volume by 10%.
            (-[WebVideoFullscreenHUDWindowController incrementVolume:]): New, increment the volume by 10%.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49653 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 695c559..fcee346 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,5 +1,16 @@
 2009-10-15  Eric Carlson  <eric.carlson at apple.com>
 
+        Reviewed by Adele Peterson.
+
+        <rdar://problem/7306052> Fullscreen max/min volume buttons non-functional
+
+        * WebView/WebVideoFullscreenHUDWindowController.mm:
+        (-[WebVideoFullscreenHUDWindowController windowDidLoad]): Set volume buttons target and action.
+        (-[WebVideoFullscreenHUDWindowController decrementVolume:]): New, decrement the volume by 10%.
+        (-[WebVideoFullscreenHUDWindowController incrementVolume:]): New, increment the volume by 10%.
+
+2009-10-15  Eric Carlson  <eric.carlson at apple.com>
+
         Reviewed by Simon Fraser.
 
         <rdar://problem/7295738> No way to mute/unmute a movie in full screen video mode
diff --git a/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm b/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm
index a57cf16..4236298 100644
--- a/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm
+++ b/WebKit/mac/WebView/WebVideoFullscreenHUDWindowController.mm
@@ -31,6 +31,9 @@
 #import "WebKitSystemInterface.h"
 #import "WebTypesInternal.h"
 #import <wtf/RetainPtr.h>
+#import <limits>
+
+using namespace std;
 
 #define HAVE_MEDIA_CONTROL (!defined(BUILDING_ON_TIGER) && !defined(BUILDING_ON_LEOPARD))
 
@@ -324,6 +327,8 @@ static NSTextField *createTimeTextField(NSRect frame)
     CGFloat left = kMargin;
     NSControl *volumeDownButton = createControlWithMediaUIControlType(WKMediaUIControlVolumeDownButton, NSMakeRect(left, top - kButtonSize / 2 - kButtonMiniSize / 2, kButtonMiniSize, kButtonMiniSize));
     [contentView addSubview:volumeDownButton];
+    [volumeDownButton setTarget:self];
+    [volumeDownButton setAction:@selector(decrementVolume:)];
     [volumeDownButton release];
 
     static const int volumeSliderWidth = 50;
@@ -336,9 +341,11 @@ static NSTextField *createTimeTextField(NSRect frame)
     [contentView addSubview:_volumeSlider];
 
     left = kMargin + kButtonMiniSize + volumeSliderWidth + kButtonMiniSize / 2;
-    NSControl *button = createControlWithMediaUIControlType(WKMediaUIControlVolumeUpButton, NSMakeRect(left, top - kButtonSize / 2 - kButtonMiniSize / 2, kButtonMiniSize, kButtonMiniSize));
-    [contentView addSubview:button];
-    [button release];
+    NSControl *volumeUpButton = createControlWithMediaUIControlType(WKMediaUIControlVolumeUpButton, NSMakeRect(left, top - kButtonSize / 2 - kButtonMiniSize / 2, kButtonMiniSize, kButtonMiniSize));
+    [volumeUpButton setTarget:self];
+    [volumeUpButton setAction:@selector(incrementVolume:)];
+    [contentView addSubview:volumeUpButton];
+    [volumeUpButton release];
     
     static const int timeTextWidth = 50;
     static const int sliderHeight = 13;
@@ -426,6 +433,24 @@ static NSTextField *createTimeTextField(NSRect frame)
     [self setVolume:[_volumeSlider doubleValue]];
 }
 
+- (void)decrementVolume:(id)sender
+{
+    if (![_delegate mediaElement])
+        return;
+
+    double volume = [self volume] - 10;
+    [self setVolume:max(volume, 0.)];
+}
+
+- (void)incrementVolume:(id)sender
+{
+    if (![_delegate mediaElement])
+        return;
+
+    double volume = [self volume] + 10;
+    [self setVolume:min(volume, [self maxVolume])];
+}
+
 - (double)volume
 {
     return [_delegate mediaElement] ? [_delegate mediaElement]->volume() * [self maxVolume] : 0;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list