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

Side by Side Diff: chrome/browser/ui/cocoa/certificate_viewer_mac_cocoa.mm

Issue 2562653002: Mac: Fix window ordering for certificate viewer/selector sheets and overlays.
Patch Set: Switch to reordering the child window array instead of setting the window level manually. Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/certificate_viewer_mac_cocoa.h" 5 #import "chrome/browser/ui/cocoa/certificate_viewer_mac_cocoa.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #import "base/mac/foundation_util.h" 8 #import "base/mac/foundation_util.h"
9 #include "chrome/browser/certificate_viewer.h" 9 #include "chrome/browser/certificate_viewer.h"
10 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" 10 #import "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 oldResizesSubviews_ = [[sheetWindow contentView] autoresizesSubviews]; 100 oldResizesSubviews_ = [[sheetWindow contentView] autoresizesSubviews];
101 [[sheetWindow contentView] setAutoresizesSubviews:NO]; 101 [[sheetWindow contentView] setAutoresizesSubviews:NO];
102 } 102 }
103 103
104 - (void)unhideSheet { 104 - (void)unhideSheet {
105 NSWindow* sheetWindow = [overlayWindow_ attachedSheet]; 105 NSWindow* sheetWindow = [overlayWindow_ attachedSheet];
106 [sheetWindow setIgnoresMouseEvents:NO]; 106 [sheetWindow setIgnoresMouseEvents:NO];
107 107
108 [[sheetWindow contentView] setAutoresizesSubviews:oldResizesSubviews_]; 108 [[sheetWindow contentView] setAutoresizesSubviews:oldResizesSubviews_];
109 [[overlayWindow_ attachedSheet] setAlphaValue:1.0]; 109 [[overlayWindow_ attachedSheet] setAlphaValue:1.0];
110
111 // Reorder child windows so the currently showing sheet/overlay is on top.
112 NSWindow* parent = [overlayWindow_ parentWindow];
113 [parent removeChildWindow:overlayWindow_];
114 [parent addChildWindow:overlayWindow_ ordered:NSWindowAbove];
115 [overlayWindow_ removeChildWindow:sheetWindow];
116 [overlayWindow_ addChildWindow:sheetWindow ordered:NSWindowAbove];
110 } 117 }
111 118
112 - (void)pulseSheet { 119 - (void)pulseSheet {
113 // NOOP 120 // NOOP
114 } 121 }
115 122
116 - (void)makeSheetKeyAndOrderFront { 123 - (void)makeSheetKeyAndOrderFront {
117 [[overlayWindow_ attachedSheet] makeKeyAndOrderFront:nil]; 124 [[overlayWindow_ attachedSheet] makeKeyAndOrderFront:nil];
118 } 125 }
119 126
(...skipping 13 matching lines...) Expand all
133 140
134 void ShowCertificateViewer(content::WebContents* web_contents, 141 void ShowCertificateViewer(content::WebContents* web_contents,
135 gfx::NativeWindow parent, 142 gfx::NativeWindow parent,
136 net::X509Certificate* cert) { 143 net::X509Certificate* cert) {
137 // SSLCertificateViewerCocoa will manage its own lifetime and will release 144 // SSLCertificateViewerCocoa will manage its own lifetime and will release
138 // itself when the dialog is closed. 145 // itself when the dialog is closed.
139 // See -[SSLCertificateViewerCocoa onConstrainedWindowClosed]. 146 // See -[SSLCertificateViewerCocoa onConstrainedWindowClosed].
140 [[SSLCertificateViewerCocoa alloc] initWithCertificate:cert 147 [[SSLCertificateViewerCocoa alloc] initWithCertificate:cert
141 forWebContents:web_contents]; 148 forWebContents:web_contents];
142 } 149 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698