| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 SSLClientAuthObserverCocoaBridge( | 42 SSLClientAuthObserverCocoaBridge( |
| 43 const content::BrowserContext* browser_context, | 43 const content::BrowserContext* browser_context, |
| 44 net::SSLCertRequestInfo* cert_request_info, | 44 net::SSLCertRequestInfo* cert_request_info, |
| 45 const chrome::SelectCertificateCallback& callback, | 45 const chrome::SelectCertificateCallback& callback, |
| 46 SSLClientCertificateSelectorCocoa* controller) | 46 SSLClientCertificateSelectorCocoa* controller) |
| 47 : SSLClientAuthObserver(browser_context, cert_request_info, callback), | 47 : SSLClientAuthObserver(browser_context, cert_request_info, callback), |
| 48 controller_(controller) { | 48 controller_(controller) { |
| 49 } | 49 } |
| 50 | 50 |
| 51 // SSLClientAuthObserver implementation: | 51 // SSLClientAuthObserver implementation: |
| 52 virtual void OnCertSelectedByNotification() override { | 52 void OnCertSelectedByNotification() override { |
| 53 [controller_ closeWebContentsModalDialog]; | 53 [controller_ closeWebContentsModalDialog]; |
| 54 } | 54 } |
| 55 | 55 |
| 56 // ConstrainedWindowMacDelegate implementation: | 56 // ConstrainedWindowMacDelegate implementation: |
| 57 virtual void OnConstrainedWindowClosed( | 57 void OnConstrainedWindowClosed(ConstrainedWindowMac* window) override { |
| 58 ConstrainedWindowMac* window) override { | |
| 59 // |onConstrainedWindowClosed| will delete the sheet which might be still | 58 // |onConstrainedWindowClosed| will delete the sheet which might be still |
| 60 // in use higher up the call stack. Wait for the next cycle of the event | 59 // in use higher up the call stack. Wait for the next cycle of the event |
| 61 // loop to call this function. | 60 // loop to call this function. |
| 62 [controller_ performSelector:@selector(onConstrainedWindowClosed) | 61 [controller_ performSelector:@selector(onConstrainedWindowClosed) |
| 63 withObject:nil | 62 withObject:nil |
| 64 afterDelay:0]; | 63 afterDelay:0]; |
| 65 } | 64 } |
| 66 | 65 |
| 67 private: | 66 private: |
| 68 SSLClientCertificateSelectorCocoa* controller_; // weak | 67 SSLClientCertificateSelectorCocoa* controller_; // weak |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 } | 228 } |
| 230 | 229 |
| 231 - (void)onConstrainedWindowClosed { | 230 - (void)onConstrainedWindowClosed { |
| 232 observer_->StopObserving(); | 231 observer_->StopObserving(); |
| 233 panel_.reset(); | 232 panel_.reset(); |
| 234 constrainedWindow_.reset(); | 233 constrainedWindow_.reset(); |
| 235 [self release]; | 234 [self release]; |
| 236 } | 235 } |
| 237 | 236 |
| 238 @end | 237 @end |
| OLD | NEW |