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

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

Issue 2562653002: Mac: Fix window ordering for certificate viewer/selector sheets and overlays.
Patch Set: 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ssl_client_certificate_selector_cocoa.h" 5 #import "chrome/browser/ui/cocoa/ssl_client_certificate_selector_cocoa.h"
6 6
7 #import <SecurityInterface/SFChooseIdentityPanel.h> 7 #import <SecurityInterface/SFChooseIdentityPanel.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 [panel_ _dismissWithCode:NSFileHandlingPanelCancelButton]; 279 [panel_ _dismissWithCode:NSFileHandlingPanelCancelButton];
280 } 280 }
281 281
282 - (void)hideSheet { 282 - (void)hideSheet {
283 NSWindow* sheetWindow = [overlayWindow_ attachedSheet]; 283 NSWindow* sheetWindow = [overlayWindow_ attachedSheet];
284 [sheetWindow setAlphaValue:0.0]; 284 [sheetWindow setAlphaValue:0.0];
285 [sheetWindow setIgnoresMouseEvents:YES]; 285 [sheetWindow setIgnoresMouseEvents:YES];
286 286
287 oldResizesSubviews_ = [[sheetWindow contentView] autoresizesSubviews]; 287 oldResizesSubviews_ = [[sheetWindow contentView] autoresizesSubviews];
288 [[sheetWindow contentView] setAutoresizesSubviews:NO]; 288 [[sheetWindow contentView] setAutoresizesSubviews:NO];
289
290 // Ensure this overlay doesn't interfere with overlays with hidden sheets.
291 [overlayWindow_ setLevel:0];
tapted 2016/12/09 04:02:00 We should be passing an NSFooWindowLevel to setLev
Patti Lor 2016/12/09 05:02:49 Yeah, I considered this. It adds some complexity b
289 } 292 }
290 293
291 - (void)unhideSheet { 294 - (void)unhideSheet {
292 NSWindow* sheetWindow = [overlayWindow_ attachedSheet]; 295 NSWindow* sheetWindow = [overlayWindow_ attachedSheet];
293 [[sheetWindow contentView] setAutoresizesSubviews:oldResizesSubviews_]; 296 [[sheetWindow contentView] setAutoresizesSubviews:oldResizesSubviews_];
294 [sheetWindow setAlphaValue:1.0]; 297 [sheetWindow setAlphaValue:1.0];
295 [sheetWindow setIgnoresMouseEvents:NO]; 298 [sheetWindow setIgnoresMouseEvents:NO];
299
300 // Set the current overlay's level higher than overlays with hidden sheets.
301 [overlayWindow_ setLevel:1];
296 } 302 }
297 303
298 - (void)pulseSheet { 304 - (void)pulseSheet {
299 // NOOP 305 // NOOP
300 } 306 }
301 307
302 - (void)makeSheetKeyAndOrderFront { 308 - (void)makeSheetKeyAndOrderFront {
303 [[overlayWindow_ attachedSheet] makeKeyAndOrderFront:nil]; 309 [[overlayWindow_ attachedSheet] makeKeyAndOrderFront:nil];
304 } 310 }
305 311
(...skipping 10 matching lines...) Expand all
316 } 322 }
317 323
318 - (void)onConstrainedWindowClosed { 324 - (void)onConstrainedWindowClosed {
319 observer_->StopObserving(); 325 observer_->StopObserving();
320 panel_.reset(); 326 panel_.reset();
321 constrainedWindow_.reset(); 327 constrainedWindow_.reset();
322 [self release]; 328 [self release];
323 } 329 }
324 330
325 @end 331 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698