summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorasvitkine <asvitkine@chromium.org>2015-12-15 15:12:03 -0800
committerCommit bot <commit-bot@chromium.org>2015-12-15 23:13:38 +0000
commit4d1e70c750dc009ce1c23e76b8c2009264dba0ef (patch)
tree028761506497750856d9df0f888423360f5d8d12
parent994e93d61a25df4c5bc3188981261657ec1be8c7 (diff)
downloadchromium_src-4d1e70c750dc009ce1c23e76b8c2009264dba0ef.zip
chromium_src-4d1e70c750dc009ce1c23e76b8c2009264dba0ef.tar.gz
chromium_src-4d1e70c750dc009ce1c23e76b8c2009264dba0ef.tar.bz2
[Mac] Fix regression where commands were disabled in full screen.
This was caused by: https://codereview.chromium.org/1250403002 That CL moved where command validation happened, but the new handler wasn't hooked up to the full screen window that gets opened on 10.6. Note: The 10.6 behavior can be simulated by changing the return value of SupportsSystemFullscreen() to false. BUG=569418 TEST=On Mac OS 10.6, check that cmd-shift-F can toggle full screen back and forth. Review URL: https://codereview.chromium.org/1520283003 Cr-Commit-Position: refs/heads/master@{#365375}
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller.mm22
1 files changed, 16 insertions, 6 deletions
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index ee3004e..40172b4 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -184,6 +184,17 @@ using content::Referrer;
using content::RenderWidgetHostView;
using content::WebContents;
+namespace {
+
+void SetUpBrowserWindowCommandHandler(NSWindow* window) {
+ // Make the window handle browser window commands.
+ [base::mac::ObjCCastStrict<ChromeEventProcessingWindow>(window)
+ setCommandHandler:[[[BrowserWindowCommandHandler alloc] init]
+ autorelease]];
+}
+
+} // namespace
+
@interface NSWindow (NSPrivateApis)
// Note: These functions are private, use -[NSObject respondsToSelector:]
// before calling them.
@@ -227,10 +238,7 @@ using content::WebContents;
browser_.reset(browser);
ownsBrowser_ = ownIt;
NSWindow* window = [self window];
- // Make the window handle browser window commands.
- [base::mac::ObjCCastStrict<ChromeEventProcessingWindow>(window)
- setCommandHandler:[[[BrowserWindowCommandHandler alloc] init]
- autorelease]];
+ SetUpBrowserWindowCommandHandler(window);
// Make the content view for the window have a layer. This will make all
// sub-views have layers. This is necessary to ensure correct layer
@@ -1448,8 +1456,10 @@ using content::WebContents;
}
- (NSWindow*)createFullscreenWindow {
- return [[[FullscreenWindow alloc] initForScreen:[[self window] screen]]
- autorelease];
+ NSWindow* window = [[[FullscreenWindow alloc]
+ initForScreen:[[self window] screen]] autorelease];
+ SetUpBrowserWindowCommandHandler(window);
+ return window;
}
- (NSInteger)numberOfTabs {