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/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 const base::string16& username, | 45 const base::string16& username, |
46 const base::string16& password) override { | 46 const base::string16& password) override { |
47 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 47 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
48 | 48 |
49 [sheet_controller_ autofillLogin:base::SysUTF16ToNSString(username) | 49 [sheet_controller_ autofillLogin:base::SysUTF16ToNSString(username) |
50 password:base::SysUTF16ToNSString(password)]; | 50 password:base::SysUTF16ToNSString(password)]; |
51 } | 51 } |
52 void OnLoginModelDestroying() override {} | 52 void OnLoginModelDestroying() override {} |
53 | 53 |
54 // LoginHandler: | 54 // LoginHandler: |
55 void BuildView(const base::string16& explanation, | 55 void BuildViewImpl(const base::string16& explanation, |
56 LoginModelData* login_model_data) override { | 56 LoginModelData* login_model_data) override { |
57 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 57 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
58 | 58 |
59 sheet_controller_.reset( | 59 sheet_controller_.reset( |
60 [[LoginHandlerSheet alloc] initWithLoginHandler:this]); | 60 [[LoginHandlerSheet alloc] initWithLoginHandler:this]); |
61 | 61 |
62 if (login_model_data) | 62 if (login_model_data) |
63 SetModel(*login_model_data); | 63 SetModel(*login_model_data); |
64 else | 64 else |
65 ResetModel(); | 65 ResetModel(); |
66 | 66 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 // Resize the text field. | 187 // Resize the text field. |
188 CGFloat windowDelta = [GTMUILocalizerAndLayoutTweaker | 188 CGFloat windowDelta = [GTMUILocalizerAndLayoutTweaker |
189 sizeToFitFixedWidthTextField:explanationField_]; | 189 sizeToFitFixedWidthTextField:explanationField_]; |
190 | 190 |
191 NSRect newFrame = [[self window] frame]; | 191 NSRect newFrame = [[self window] frame]; |
192 newFrame.size.height += windowDelta; | 192 newFrame.size.height += windowDelta; |
193 [[self window] setFrame:newFrame display:NO]; | 193 [[self window] setFrame:newFrame display:NO]; |
194 } | 194 } |
195 | 195 |
196 @end | 196 @end |
OLD | NEW |