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

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

Issue 1053463002: MacViews: Use native certificate viewer in MacViews browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@translate
Patch Set: Fix for tapted and rebase Created 5 years, 9 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 | « no previous file | chrome/browser/ui/cocoa/create_native_web_modal_manager_cocoa.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 c408dcfd0c064ae86bede07e33947f3e5c066873..9375daa5b8af5f1c90ff7df3fc44c2b18a884877 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,19 @@ 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)
+ view = devtools_view;
+ return [view convertRect:[view bounds] toView:nil];
+}
+
} // namespace
// An invisible overlay window placed on top of the sheet's parent view.
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/create_native_web_modal_manager_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698