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

Unified Diff: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm

Issue 420413002: Ensure dialogs are centered on browser windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test works Created 6 years, 4 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
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_strip_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
index 1a43e447ae9659c61ddc63dad1aafde0ed1ed34c..e8a76a1299733fc4f04e4adcfbd4b8749758f251 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
@@ -19,7 +19,6 @@
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/autocomplete/autocomplete_classifier.h"
#include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
-#include "chrome/browser/devtools/devtools_window.h"
#include "chrome/browser/extensions/tab_helper.h"
#include "chrome/browser/favicon/favicon_tab_helper.h"
#include "chrome/browser/profiles/profile.h"
@@ -2222,9 +2221,18 @@ NSView* GetSheetParentViewForWebContents(WebContents* web_contents) {
// View hierarchy of the contents view:
// NSView -- switchView, same for all tabs
// +- NSView -- TabContentsController's view
- // +- TabContentsViewCocoa
+ // +- WebContentsViewCocoa
//
// Changing it? Do not forget to modify
// -[TabStripController swapInTabAtIndex:] too.
return [web_contents->GetNativeView() superview];
}
+
+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];
+ return [devtools_view convertRect:[devtools_view bounds] toView:nil];
+}
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_strip_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698