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

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: indent Created 8 years, 7 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..a4a8645b0cfe5b3caff083a70e0be0d749fd2adf 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,11 @@ 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 +170,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.
@@ -271,6 +271,8 @@ const float kHideDuration = 0.7;
}
- (NSString*)getLabelText {
+ if (bubbleType_ == FEB_TYPE_NONE)
+ return @"";
return SysUTF16ToNSString(fullscreen_bubble::GetLabelTextForType(
bubbleType_, url_, browser_->profile()->GetExtensionService()));
}
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_private.mm ('k') | chrome/browser/ui/fullscreen_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698