OLD | NEW |
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 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 void ShowSSLClientCertificateSelector( | 75 void ShowSSLClientCertificateSelector( |
76 content::WebContents* contents, | 76 content::WebContents* contents, |
77 net::SSLCertRequestInfo* cert_request_info, | 77 net::SSLCertRequestInfo* cert_request_info, |
78 scoped_ptr<content::ClientCertificateDelegate> delegate) { | 78 scoped_ptr<content::ClientCertificateDelegate> delegate) { |
79 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 79 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
80 | 80 |
81 // Not all WebContentses can show modal dialogs. | 81 // Not all WebContentses can show modal dialogs. |
82 // | 82 // |
83 // TODO(davidben): Move this hook to the WebContentsDelegate and only try to | 83 // TODO(davidben): Move this hook to the WebContentsDelegate and only try to |
84 // show a dialog in Browser's implementation. https://crbug.com/456255 | 84 // show a dialog in Browser's implementation. https://crbug.com/456255 |
85 if (web_modal::PopupManager::FromWebContents(contents) == nullptr) | 85 if (!ConstrainedWindowMac::HasTopLevelDialogManager(contents)) |
86 return; | 86 return; |
87 | 87 |
88 // The dialog manages its own lifetime. | 88 // The dialog manages its own lifetime. |
89 SSLClientCertificateSelectorCocoa* selector = | 89 SSLClientCertificateSelectorCocoa* selector = |
90 [[SSLClientCertificateSelectorCocoa alloc] | 90 [[SSLClientCertificateSelectorCocoa alloc] |
91 initWithBrowserContext:contents->GetBrowserContext() | 91 initWithBrowserContext:contents->GetBrowserContext() |
92 certRequestInfo:cert_request_info | 92 certRequestInfo:cert_request_info |
93 delegate:delegate.Pass()]; | 93 delegate:delegate.Pass()]; |
94 [selector displayForWebContents:contents]; | 94 [selector displayForWebContents:contents]; |
95 } | 95 } |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 } | 256 } |
257 | 257 |
258 - (void)onConstrainedWindowClosed { | 258 - (void)onConstrainedWindowClosed { |
259 observer_->StopObserving(); | 259 observer_->StopObserving(); |
260 panel_.reset(); | 260 panel_.reset(); |
261 constrainedWindow_.reset(); | 261 constrainedWindow_.reset(); |
262 [self release]; | 262 [self release]; |
263 } | 263 } |
264 | 264 |
265 @end | 265 @end |
OLD | NEW |