| 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/login_prompt_cocoa.h" | 5 #import "chrome/browser/ui/cocoa/login_prompt_cocoa.h" |
| 6 | 6 |
| 7 #include "base/mac/bundle_locations.h" | 7 #include "base/mac/bundle_locations.h" |
| 8 #include "base/mac/mac_util.h" | 8 #include "base/mac/mac_util.h" |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 145 |
| 146 - (void)dealloc { | 146 - (void)dealloc { |
| 147 // The buttons could be in a modal loop, so disconnect them so they cannot | 147 // The buttons could be in a modal loop, so disconnect them so they cannot |
| 148 // call back to us after we're dead. | 148 // call back to us after we're dead. |
| 149 [loginButton_ setTarget:nil]; | 149 [loginButton_ setTarget:nil]; |
| 150 [cancelButton_ setTarget:nil]; | 150 [cancelButton_ setTarget:nil]; |
| 151 [super dealloc]; | 151 [super dealloc]; |
| 152 } | 152 } |
| 153 | 153 |
| 154 - (IBAction)loginPressed:(id)sender { | 154 - (IBAction)loginPressed:(id)sender { |
| 155 using base::SysNSStringToWide; | |
| 156 [NSApp endSheet:[self window]]; | 155 [NSApp endSheet:[self window]]; |
| 157 handler_->OnLoginPressed( | 156 handler_->OnLoginPressed( |
| 158 base::SysNSStringToUTF16([nameField_ stringValue]), | 157 base::SysNSStringToUTF16([nameField_ stringValue]), |
| 159 base::SysNSStringToUTF16([passwordField_ stringValue])); | 158 base::SysNSStringToUTF16([passwordField_ stringValue])); |
| 160 } | 159 } |
| 161 | 160 |
| 162 - (IBAction)cancelPressed:(id)sender { | 161 - (IBAction)cancelPressed:(id)sender { |
| 163 [NSApp endSheet:[self window]]; | 162 [NSApp endSheet:[self window]]; |
| 164 handler_->OnCancelPressed(); | 163 handler_->OnCancelPressed(); |
| 165 } | 164 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 189 sizeToFitFixedWidthTextField:explanationField_]; | 188 sizeToFitFixedWidthTextField:explanationField_]; |
| 190 | 189 |
| 191 // Resize the window (no shifting needed due to window layout). | 190 // Resize the window (no shifting needed due to window layout). |
| 192 NSSize windowDelta = NSMakeSize(0, explanationShift); | 191 NSSize windowDelta = NSMakeSize(0, explanationShift); |
| 193 [GTMUILocalizerAndLayoutTweaker | 192 [GTMUILocalizerAndLayoutTweaker |
| 194 resizeWindowWithoutAutoResizingSubViews:[self window] | 193 resizeWindowWithoutAutoResizingSubViews:[self window] |
| 195 delta:windowDelta]; | 194 delta:windowDelta]; |
| 196 } | 195 } |
| 197 | 196 |
| 198 @end | 197 @end |
| OLD | NEW |