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

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 tests 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
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.

Powered by Google App Engine
This is Rietveld 408576698