Chromium Code Reviews| 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 c408dcfd0c064ae86bede07e33947f3e5c066873..a2f87cfcf340178ecca0790b10ec8b7ce0578622 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 |
| @@ -9,7 +9,6 @@ |
| #include "base/logging.h" |
| #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet.h" |
| #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_sheet_info.h" |
| -#import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
| namespace { |
| @@ -21,6 +20,21 @@ NSValue* GetKeyForParentWindow(NSWindow* parent_window) { |
| return [NSValue valueWithNonretainedObject:parent_window]; |
| } |
| +// Returns the bounds to use when showing a sheet for a given parent view. This |
| +// returns a rect in window coordinates. |
| +NSRect GetSheetParentBoundsForParentView(NSView* view) { |
| + // If the devtools view is open, it shrinks the size of the WebContents, so go |
| + // up the hierarchy to the devtools container view to avoid that. Note that |
| + // the devtools view is always in the hierarchy even if it is not open or it |
| + // is detached. |
| + NSView* devtools_view = [[[view superview] superview] superview]; |
| + if (devtools_view) { |
| + return [devtools_view convertRect:[devtools_view bounds] toView:nil]; |
| + } else { |
|
tapted
2015/04/02 04:35:22
hm - I see you're just moving this, but this fails
Andre
2015/04/02 17:17:31
Done.
|
| + return [view convertRect:[view bounds] toView:nil]; |
| + } |
| +} |
| + |
| } // namespace |
| // An invisible overlay window placed on top of the sheet's parent view. |