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

Unified Diff: chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.mm

Issue 11416309: Fix constrained window position for inactive tab (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.mm
diff --git a/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.mm b/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.mm
index 424c4930a30364555b58659938a15c9f5f25e86a..be7a7d057fc18e14aa02e8148ade5e9d0c1a8b94 100644
--- a/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.mm
+++ b/chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller.mm
@@ -182,6 +182,7 @@ NSValue* GetKeyForParentWindow(NSWindow* parent_window) {
- (void)parentViewDidBecomeActive:(NSView*)parentView {
[[self findSheetInfoForParentView:activeView_] hideSheet];
activeView_.reset([parentView retain]);
+ [self updateSheetPosition:parentView];
[[self findSheetInfoForParentView:activeView_] showSheet];
}
@@ -236,15 +237,18 @@ NSValue* GetKeyForParentWindow(NSWindow* parent_window) {
}
- (void)onParentViewFrameDidChange:(NSNotification*)note {
- [self updateSheetPosition:[note object]];
+ NSView* parentView = [note object];
+ if (![activeView_ isEqual:parentView])
+ return;
+ [self updateSheetPosition:parentView];
}
- (void)updateSheetPosition:(NSView*)parentView {
- if (![activeView_ isEqual:parentView])
- return;
ConstrainedWindowSheetInfo* info =
[self findSheetInfoForParentView:parentView];
- DCHECK(info);
+ if (!info)
+ return;
+
NSRect rect = [self overlayWindowFrameForParentView:parentView];
[[info overlayWindow] setFrame:rect display:YES];
NSPoint origin = [self originForSheetSize:[[info sheet] frame].size
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698