Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: chrome/browser/ui/views/login_view.cc

Issue 6088008: Remove wstring from l10n_util. Part 7.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/views/login_view.h" 5 #include "chrome/browser/views/login_view.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 #include "base/utf_string_conversions.h"
12 #include "grit/generated_resources.h" 13 #include "grit/generated_resources.h"
13 #include "views/grid_layout.h" 14 #include "views/grid_layout.h"
14 #include "views/controls/label.h" 15 #include "views/controls/label.h"
15 #include "views/controls/textfield/textfield.h" 16 #include "views/controls/textfield/textfield.h"
16 #include "views/standard_layout.h" 17 #include "views/standard_layout.h"
17 #include "views/widget/root_view.h" 18 #include "views/widget/root_view.h"
18 19
19 static const int kMessageWidth = 320; 20 static const int kMessageWidth = 320;
20 static const int kTextfieldStackHorizontalSpacing = 30; 21 static const int kTextfieldStackHorizontalSpacing = 30;
21 22
22 using views::GridLayout; 23 using views::GridLayout;
23 24
24 /////////////////////////////////////////////////////////////////////////////// 25 ///////////////////////////////////////////////////////////////////////////////
25 // LoginView, public: 26 // LoginView, public:
26 27
27 LoginView::LoginView(const std::wstring& explanation, 28 LoginView::LoginView(const std::wstring& explanation,
28 bool focus_view) 29 bool focus_view)
29 : username_field_(new views::Textfield), 30 : username_field_(new views::Textfield),
30 password_field_(new views::Textfield(views::Textfield::STYLE_PASSWORD)), 31 password_field_(new views::Textfield(views::Textfield::STYLE_PASSWORD)),
31 username_label_(new views::Label( 32 username_label_(new views::Label(UTF16ToWide(
32 l10n_util::GetString(IDS_LOGIN_DIALOG_USERNAME_FIELD))), 33 l10n_util::GetStringUTF16(IDS_LOGIN_DIALOG_USERNAME_FIELD)))),
33 password_label_(new views::Label( 34 password_label_(new views::Label(UTF16ToWide(
34 l10n_util::GetString(IDS_LOGIN_DIALOG_PASSWORD_FIELD))), 35 l10n_util::GetStringUTF16(IDS_LOGIN_DIALOG_PASSWORD_FIELD)))),
35 message_label_(new views::Label(explanation)), 36 message_label_(new views::Label(explanation)),
36 ALLOW_THIS_IN_INITIALIZER_LIST(focus_grabber_factory_(this)), 37 ALLOW_THIS_IN_INITIALIZER_LIST(focus_grabber_factory_(this)),
37 login_model_(NULL), 38 login_model_(NULL),
38 focus_delayed_(false), 39 focus_delayed_(false),
39 focus_view_(focus_view) { 40 focus_view_(focus_view) {
40 message_label_->SetMultiLine(true); 41 message_label_->SetMultiLine(true);
41 message_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); 42 message_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
42 message_label_->SetAllowCharacterBreak(true); 43 message_label_->SetAllowCharacterBreak(true);
43 44
44 // Initialize the Grid Layout Manager used for this dialog box. 45 // Initialize the Grid Layout Manager used for this dialog box.
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 144
144 void LoginView::FocusFirstField() { 145 void LoginView::FocusFirstField() {
145 DCHECK(focus_view_); 146 DCHECK(focus_view_);
146 if (GetFocusManager()) { 147 if (GetFocusManager()) {
147 username_field_->RequestFocus(); 148 username_field_->RequestFocus();
148 } else { 149 } else {
149 // We are invisible - delay until it is no longer the case. 150 // We are invisible - delay until it is no longer the case.
150 focus_delayed_ = true; 151 focus_delayed_ = true;
151 } 152 }
152 } 153 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698