| 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 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 panel_.reset([[SFChooseIdentityPanel alloc] init]); | 172 panel_.reset([[SFChooseIdentityPanel alloc] init]); |
| 173 [panel_ setInformativeText:message]; | 173 [panel_ setInformativeText:message]; |
| 174 [panel_ setDefaultButtonTitle:l10n_util::GetNSString(IDS_OK)]; | 174 [panel_ setDefaultButtonTitle:l10n_util::GetNSString(IDS_OK)]; |
| 175 [panel_ setAlternateButtonTitle:l10n_util::GetNSString(IDS_CANCEL)]; | 175 [panel_ setAlternateButtonTitle:l10n_util::GetNSString(IDS_CANCEL)]; |
| 176 SecPolicyRef sslPolicy; | 176 SecPolicyRef sslPolicy; |
| 177 if (net::x509_util::CreateSSLClientPolicy(&sslPolicy) == noErr) { | 177 if (net::x509_util::CreateSSLClientPolicy(&sslPolicy) == noErr) { |
| 178 [panel_ setPolicies:(id)sslPolicy]; | 178 [panel_ setPolicies:(id)sslPolicy]; |
| 179 CFRelease(sslPolicy); | 179 CFRelease(sslPolicy); |
| 180 } | 180 } |
| 181 | 181 |
| 182 constrainedWindow_.reset( | 182 constrainedWindow_ = |
| 183 new ConstrainedWindowMac(observer_.get(), webContents, self)); | 183 CreateAndShowWebModalDialogMac(observer_.get(), webContents, self); |
| 184 observer_->StartObserving(); | 184 observer_->StartObserving(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 - (void)closeWebContentsModalDialog { | 187 - (void)closeWebContentsModalDialog { |
| 188 DCHECK(constrainedWindow_); | 188 DCHECK(constrainedWindow_); |
| 189 constrainedWindow_->CloseWebContentsModalDialog(); | 189 constrainedWindow_->CloseWebContentsModalDialog(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 - (NSWindow*)overlayWindow { | 192 - (NSWindow*)overlayWindow { |
| 193 return overlayWindow_; | 193 return overlayWindow_; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 } | 253 } |
| 254 | 254 |
| 255 - (void)makeSheetKeyAndOrderFront { | 255 - (void)makeSheetKeyAndOrderFront { |
| 256 [[overlayWindow_ attachedSheet] makeKeyAndOrderFront:nil]; | 256 [[overlayWindow_ attachedSheet] makeKeyAndOrderFront:nil]; |
| 257 } | 257 } |
| 258 | 258 |
| 259 - (void)updateSheetPosition { | 259 - (void)updateSheetPosition { |
| 260 // NOOP | 260 // NOOP |
| 261 } | 261 } |
| 262 | 262 |
| 263 - (void)resizeWithNewSize:(NSSize)size { |
| 264 // NOOP |
| 265 } |
| 266 |
| 263 - (NSWindow*)sheetWindow { | 267 - (NSWindow*)sheetWindow { |
| 264 return panel_; | 268 return panel_; |
| 265 } | 269 } |
| 266 | 270 |
| 267 - (void)onConstrainedWindowClosed { | 271 - (void)onConstrainedWindowClosed { |
| 268 observer_->StopObserving(); | 272 observer_->StopObserving(); |
| 269 panel_.reset(); | 273 panel_.reset(); |
| 270 constrainedWindow_.reset(); | 274 constrainedWindow_.reset(); |
| 271 [self release]; | 275 [self release]; |
| 272 } | 276 } |
| 273 | 277 |
| 274 @end | 278 @end |
| OLD | NEW |