Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5865)

Unified Diff: chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm

Issue 10261011: Windowed mode mouse lock addded to fullscreen controller. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm
diff --git a/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm b/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm
index dbd18153cf0dca9294be013b4f8d846766778d47..d0cf0ea03ef528ee5f53d92b86b661bb9fc1b6c2 100644
--- a/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm
@@ -120,10 +120,9 @@ const float kHideDuration = 0.7;
[self showButtons:NO];
[self hideSoon];
}
- NSRect windowFrame = [owner_ window].frame;
[tweaker_ tweakUI:info_bubble];
- [self positionInWindowAtTop:NSHeight(windowFrame) width:NSWidth(windowFrame)];
[[owner_ window] addChildWindow:info_bubble ordered:NSWindowAbove];
+ [owner_ layoutSubviews];
[info_bubble orderFront:self];
}
@@ -136,9 +135,14 @@ const float kHideDuration = 0.7;
- (void)positionInWindowAtTop:(CGFloat)maxY width:(CGFloat)maxWidth {
NSRect windowFrame = [self window].frame;
+ NSRect ownerWindowFrame = [owner_ window].frame;
NSPoint origin;
origin.x = (int)(maxWidth/2 - NSWidth(windowFrame)/2);
origin.y = maxY - NSHeight(windowFrame);
+
+ origin.x = ownerWindowFrame.origin.x +
+ (int)(NSWidth(ownerWindowFrame)/2 - NSWidth(windowFrame)/2);
+ origin.y = ownerWindowFrame.origin.y + maxY - NSHeight(windowFrame);
[[self window] setFrameOrigin:origin];
}
@@ -169,8 +173,7 @@ const float kHideDuration = 0.7;
// Relayout. A bit jumpy, but functional.
[tweaker_ tweakUI:[self window]];
- NSRect windowFrame = [owner_ window].frame;
- [self positionInWindowAtTop:NSHeight(windowFrame) width:NSWidth(windowFrame)];
+ [owner_ layoutSubviews];
}
// Called when someone clicks on the embedded link.

Powered by Google App Engine
This is Rietveld 408576698