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 #include "content/shell/shell_login_dialog.h" | 5 #include "content/shell/shell_login_dialog.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
11 #import "base/memory/scoped_nsobject.h" | 11 #import "base/mac/scoped_nsobject.h" |
12 #include "base/strings/sys_string_conversions.h" | 12 #include "base/strings/sys_string_conversions.h" |
13 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
14 #import "ui/base/cocoa/nib_loading.h" | 14 #import "ui/base/cocoa/nib_loading.h" |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 const int kUsernameFieldTag = 1; | 18 const int kUsernameFieldTag = 1; |
19 const int kPasswordFieldTag = 2; | 19 const int kPasswordFieldTag = 2; |
20 | 20 |
21 } // namespace | 21 } // namespace |
22 | 22 |
23 // Helper object that receives the notification that the dialog/sheet is | 23 // Helper object that receives the notification that the dialog/sheet is |
24 // going away. | 24 // going away. |
25 @interface ShellLoginDialogHelper : NSObject<NSAlertDelegate> { | 25 @interface ShellLoginDialogHelper : NSObject<NSAlertDelegate> { |
26 @private | 26 @private |
27 scoped_nsobject<NSAlert> alert_; | 27 base::scoped_nsobject<NSAlert> alert_; |
28 NSTextField* usernameField_; // WEAK; owned by alert_ | 28 NSTextField* usernameField_; // WEAK; owned by alert_ |
29 NSSecureTextField* passwordField_; // WEAK; owned by alert_ | 29 NSSecureTextField* passwordField_; // WEAK; owned by alert_ |
30 } | 30 } |
31 | 31 |
32 - (NSAlert*)alert; | 32 - (NSAlert*)alert; |
33 - (NSView*)accessoryView; | 33 - (NSView*)accessoryView; |
34 - (void)focus; | 34 - (void)focus; |
35 - (void)alertDidEnd:(NSAlert*)alert | 35 - (void)alertDidEnd:(NSAlert*)alert |
36 returnCode:(int)returnCode | 36 returnCode:(int)returnCode |
37 contextInfo:(void*)contextInfo; | 37 contextInfo:(void*)contextInfo; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 [helper_ release]; | 113 [helper_ release]; |
114 helper_ = nil; | 114 helper_ = nil; |
115 } | 115 } |
116 | 116 |
117 void ShellLoginDialog::PlatformRequestCancelled() { | 117 void ShellLoginDialog::PlatformRequestCancelled() { |
118 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 118 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
119 [helper_ cancel]; | 119 [helper_ cancel]; |
120 } | 120 } |
121 | 121 |
122 } // namespace content | 122 } // namespace content |
OLD | NEW |