Index: chrome/browser/ui/cocoa/certificate_viewer_mac.mm |
diff --git a/chrome/browser/ui/cocoa/certificate_viewer_mac.mm b/chrome/browser/ui/cocoa/certificate_viewer_mac.mm |
index 1a079cac5723e8e6dc1df15863bd4d3c51d4dd17..42ff57d1e5efe9e2a6224d5b428e5774ccf69755 100644 |
--- a/chrome/browser/ui/cocoa/certificate_viewer_mac.mm |
+++ b/chrome/browser/ui/cocoa/certificate_viewer_mac.mm |
@@ -165,33 +165,15 @@ void ShowCertificateViewer(content::WebContents* web_contents, |
- (void)hideSheet { |
NSWindow* sheetWindow = [overlayWindow_ attachedSheet]; |
[sheetWindow setAlphaValue:0.0]; |
+ [sheetWindow setIgnoresMouseEvents:YES]; |
oldResizesSubviews_ = [[sheetWindow contentView] autoresizesSubviews]; |
[[sheetWindow contentView] setAutoresizesSubviews:NO]; |
- |
- oldSheetFrame_ = [sheetWindow frame]; |
- NSRect overlayFrame = [overlayWindow_ frame]; |
- oldSheetFrame_.origin.x -= NSMinX(overlayFrame); |
- oldSheetFrame_.origin.y -= NSMinY(overlayFrame); |
- oldOverlaySize_ = [overlayWindow_ frame].size; |
- [sheetWindow setFrame:ui::kWindowSizeDeterminedLater display:NO]; |
} |
- (void)unhideSheet { |
NSWindow* sheetWindow = [overlayWindow_ attachedSheet]; |
- NSRect overlayFrame = [overlayWindow_ frame]; |
- |
- // If the overlay frame's size has changed, the position offsets need to be |
tapted
2016/06/17 06:11:33
So does this happen automatically? (i.e. does the
Patti Lor
2016/06/20 03:42:28
Yep, the certificate viewer position is controlled
|
- // calculated. Since the certificate is horizontally centered, so the x |
- // offset is calculated by halving the width difference. In addition, |
- // because the certificate is located directly below the toolbar, the y |
- // offset is just the difference in height. |
- CGFloat yOffset = (NSHeight(overlayFrame) - oldOverlaySize_.height); |
- CGFloat xOffset = (NSWidth(overlayFrame) - oldOverlaySize_.width) / 2; |
- |
- oldSheetFrame_.origin.x += NSMinX(overlayFrame) + xOffset; |
- oldSheetFrame_.origin.y += NSMinY(overlayFrame) + yOffset; |
- [sheetWindow setFrame:oldSheetFrame_ display:NO]; |
+ [sheetWindow setIgnoresMouseEvents:NO]; |
[[sheetWindow contentView] setAutoresizesSubviews:oldResizesSubviews_]; |
[[overlayWindow_ attachedSheet] setAlphaValue:1.0]; |