Commit 6c2999b3 authored by rohitrao@chromium.org's avatar rohitrao@chromium.org

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
parent 79381e52
...@@ -894,7 +894,10 @@ gfx::Rect InstantLoader::GetOmniboxBoundsInTermsOfPreview() { ...@@ -894,7 +894,10 @@ gfx::Rect InstantLoader::GetOmniboxBoundsInTermsOfPreview() {
// In the current Chrome UI, these must always be true so they sanity check // 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. // 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.x());
DCHECK_LE(0, intersection.width()); DCHECK_LE(0, intersection.width());
DCHECK_LE(0, intersection.height()); DCHECK_LE(0, intersection.height());
......
...@@ -274,9 +274,13 @@ enum { ...@@ -274,9 +274,13 @@ enum {
[window setAnimationBehavior:NSWindowAnimationBehaviorDocumentWindow]; [window setAnimationBehavior:NSWindowAnimationBehaviorDocumentWindow];
// Set the window to participate in Lion Fullscreen mode. Setting this flag // 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]; NSUInteger collectionBehavior = [window collectionBehavior];
collectionBehavior |= NSWindowCollectionBehaviorFullScreenPrimary; collectionBehavior |= browser_->type() == Browser::TYPE_TABBED ?
NSWindowCollectionBehaviorFullScreenPrimary :
NSWindowCollectionBehaviorFullScreenAuxiliary;
[window setCollectionBehavior:collectionBehavior]; [window setCollectionBehavior:collectionBehavior];
// Get the most appropriate size for the window, then enforce the // Get the most appropriate size for the window, then enforce the
......
...@@ -852,6 +852,9 @@ willPositionSheet:(NSWindow*)sheet ...@@ -852,6 +852,9 @@ willPositionSheet:(NSWindow*)sheet
- (void)windowDidFailToExitFullScreen:(NSWindow*)window { - (void)windowDidFailToExitFullScreen:(NSWindow*)window {
[self deregisterForContentViewResizeNotifications]; [self deregisterForContentViewResizeNotifications];
// Force a relayout to try and get the window back into a reasonable state.
[self layoutSubviews];
} }
- (void)enableBarVisibilityUpdates { - (void)enableBarVisibilityUpdates {
......
...@@ -398,12 +398,14 @@ BOOL ThePasteboardIsTooDamnBig() { ...@@ -398,12 +398,14 @@ BOOL ThePasteboardIsTooDamnBig() {
} }
// If the escape key was pressed and no revert happened and we're in // 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:)) { if (cmd == @selector(cancelOperation:)) {
BrowserWindowController* windowController = BrowserWindowController* windowController =
[BrowserWindowController browserWindowControllerForView:self]; [BrowserWindowController browserWindowControllerForView:self];
if ([windowController inPresentationMode]) { if ([windowController isFullscreen]) {
[windowController focusTabContents]; [windowController focusTabContents];
textChangedByKeyEvents_ = NO;
return; return;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment