summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-09 20:39:40 +0000
committerrohitrao@chromium.org <rohitrao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-09 20:39:40 +0000
commit6c2999b35364b8882f8b9d10275ce46caa7d3a7c (patch)
tree505293deed1f90ee6d1f842aa9cf9e2fafa78bb4 /chrome
parent79381e52684ce95b6619d284307c6560c27d21ba (diff)
downloadchromium_src-6c2999b35364b8882f8b9d10275ce46caa7d3a7c.zip
chromium_src-6c2999b35364b8882f8b9d10275ce46caa7d3a7c.tar.gz
chromium_src-6c2999b35364b8882f8b9d10275ce46caa7d3a7c.tar.bz2
Grab bag of bugfixes for Lion fullscreen mode.
- Removes a DCHECK() in the InstantLoader that fired incorrectly in presentation mode. In presentation mode, the omnibox is entirely enclosed by the web contents, so one part of the DCHECK() was incorrect. - Mark popups and panels as auxiliary fullscreen windows. This allows them to share a space with a fullscreen window, but not to become a fullscreen window. - Force a relayout in windowDidFailToExitFullScreen. Despite the name of the delegate method, when a window fails to exit fullscreen mode, it actually does exit fullscreen mode. Forcing a relayout gets the window to draw correctly in this "failure" case. - Fixes a DCHECK() when pressing escape in fullscreen mode. - Pressing escape when the omnibox is focused (in non-presentation fullscreen mode) will now drop the window out of fullscreen mode. BUG=74065 TEST=None Review URL: http://codereview.chromium.org/7599029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96056 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/instant/instant_loader.cc5
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller.mm8
-rw-r--r--chrome/browser/ui/cocoa/browser_window_controller_private.mm3
-rw-r--r--chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm6
4 files changed, 17 insertions, 5 deletions
diff --git a/chrome/browser/instant/instant_loader.cc b/chrome/browser/instant/instant_loader.cc
index fc34841..3f1725e 100644
--- a/chrome/browser/instant/instant_loader.cc
+++ b/chrome/browser/instant/instant_loader.cc
@@ -894,7 +894,10 @@ gfx::Rect InstantLoader::GetOmniboxBoundsInTermsOfPreview() {
// In the current Chrome UI, these must always be true so they sanity check
// the above operations. In a future UI, these may be removed or adjusted.
- DCHECK_EQ(0, intersection.y());
+ // There is no point in sanity-checking |intersection.y()| because the omnibox
+ // can be placed anywhere vertically relative to the preview (for example, in
+ // Mac fullscreen mode, the omnibox is entirely enclosed by the preview
+ // bounds).
DCHECK_LE(0, intersection.x());
DCHECK_LE(0, intersection.width());
DCHECK_LE(0, intersection.height());
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index 212e31e..0247609 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -274,9 +274,13 @@ enum {
[window setAnimationBehavior:NSWindowAnimationBehaviorDocumentWindow];
// Set the window to participate in Lion Fullscreen mode. Setting this flag
- // has no effect on Snow Leopard or earlier.
+ // has no effect on Snow Leopard or earlier. Popups and the devtools panel
+ // can share a fullscreen space with a tabbed window, but they can not be
+ // primary fullscreen windows.
NSUInteger collectionBehavior = [window collectionBehavior];
- collectionBehavior |= NSWindowCollectionBehaviorFullScreenPrimary;
+ collectionBehavior |= browser_->type() == Browser::TYPE_TABBED ?
+ NSWindowCollectionBehaviorFullScreenPrimary :
+ NSWindowCollectionBehaviorFullScreenAuxiliary;
[window setCollectionBehavior:collectionBehavior];
// Get the most appropriate size for the window, then enforce the
diff --git a/chrome/browser/ui/cocoa/browser_window_controller_private.mm b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
index d7b2c84..1506ce1 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller_private.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller_private.mm
@@ -852,6 +852,9 @@ willPositionSheet:(NSWindow*)sheet
- (void)windowDidFailToExitFullScreen:(NSWindow*)window {
[self deregisterForContentViewResizeNotifications];
+
+ // Force a relayout to try and get the window back into a reasonable state.
+ [self layoutSubviews];
}
- (void)enableBarVisibilityUpdates {
diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm
index 30d2f59..817cabc 100644
--- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm
+++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm
@@ -398,12 +398,14 @@ BOOL ThePasteboardIsTooDamnBig() {
}
// If the escape key was pressed and no revert happened and we're in
- // fullscreen mode, make it resign key.
+ // fullscreen mode, give focus to the web contents, which may dismiss the
+ // overlay.
if (cmd == @selector(cancelOperation:)) {
BrowserWindowController* windowController =
[BrowserWindowController browserWindowControllerForView:self];
- if ([windowController inPresentationMode]) {
+ if ([windowController isFullscreen]) {
[windowController focusTabContents];
+ textChangedByKeyEvents_ = NO;
return;
}
}