OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/views/login_view.h" | 5 #include "chrome/browser/ui/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" |
(...skipping 25 matching lines...) Expand all Loading... |
36 message_label_(new views::Label(explanation)), | 36 message_label_(new views::Label(explanation)), |
37 ALLOW_THIS_IN_INITIALIZER_LIST(focus_grabber_factory_(this)), | 37 ALLOW_THIS_IN_INITIALIZER_LIST(focus_grabber_factory_(this)), |
38 login_model_(NULL), | 38 login_model_(NULL), |
39 focus_delayed_(false), | 39 focus_delayed_(false), |
40 focus_view_(focus_view) { | 40 focus_view_(focus_view) { |
41 message_label_->SetMultiLine(true); | 41 message_label_->SetMultiLine(true); |
42 message_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 42 message_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); |
43 message_label_->SetAllowCharacterBreak(true); | 43 message_label_->SetAllowCharacterBreak(true); |
44 | 44 |
45 // Initialize the Grid Layout Manager used for this dialog box. | 45 // Initialize the Grid Layout Manager used for this dialog box. |
46 GridLayout* layout = CreatePanelGridLayout(this); | 46 GridLayout* layout = GridLayout::CreatePanel(this); |
47 SetLayoutManager(layout); | 47 SetLayoutManager(layout); |
48 | 48 |
49 // Add the column set for the information message at the top of the dialog | 49 // Add the column set for the information message at the top of the dialog |
50 // box. | 50 // box. |
51 const int single_column_view_set_id = 0; | 51 const int single_column_view_set_id = 0; |
52 views::ColumnSet* column_set = | 52 views::ColumnSet* column_set = |
53 layout->AddColumnSet(single_column_view_set_id); | 53 layout->AddColumnSet(single_column_view_set_id); |
54 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, | 54 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, |
55 GridLayout::FIXED, kMessageWidth, 0); | 55 GridLayout::FIXED, kMessageWidth, 0); |
56 | 56 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 144 |
145 void LoginView::FocusFirstField() { | 145 void LoginView::FocusFirstField() { |
146 DCHECK(focus_view_); | 146 DCHECK(focus_view_); |
147 if (GetFocusManager()) { | 147 if (GetFocusManager()) { |
148 username_field_->RequestFocus(); | 148 username_field_->RequestFocus(); |
149 } else { | 149 } else { |
150 // We are invisible - delay until it is no longer the case. | 150 // We are invisible - delay until it is no longer the case. |
151 focus_delayed_ = true; | 151 focus_delayed_ = true; |
152 } | 152 } |
153 } | 153 } |
OLD | NEW |