| 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 "chrome/browser/ui/views/login_view.h" | 5 #include "chrome/browser/ui/views/login_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/views/harmony/layout_delegate.h" | 7 #include "chrome/browser/ui/views/harmony/layout_delegate.h" |
| 8 #include "chrome/browser/ui/views/layout_utils.h" | |
| 9 #include "components/strings/grit/components_strings.h" | 8 #include "components/strings/grit/components_strings.h" |
| 10 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
| 11 #include "ui/views/controls/label.h" | 10 #include "ui/views/controls/label.h" |
| 12 #include "ui/views/controls/textfield/textfield.h" | 11 #include "ui/views/controls/textfield/textfield.h" |
| 13 #include "ui/views/layout/grid_layout.h" | 12 #include "ui/views/layout/grid_layout.h" |
| 14 | 13 |
| 15 static const int kMessageWidth = 320; | 14 static const int kMessageWidth = 320; |
| 16 static const int kTextfieldStackHorizontalSpacing = 30; | 15 static const int kTextfieldStackHorizontalSpacing = 30; |
| 17 | 16 |
| 18 using password_manager::LoginModel; | 17 using password_manager::LoginModel; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 34 message_label_(nullptr), | 33 message_label_(nullptr), |
| 35 login_model_(login_model_data ? login_model_data->model : nullptr) { | 34 login_model_(login_model_data ? login_model_data->model : nullptr) { |
| 36 LayoutDelegate* layout_delegate = LayoutDelegate::Get(); | 35 LayoutDelegate* layout_delegate = LayoutDelegate::Get(); |
| 37 password_field_->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD); | 36 password_field_->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD); |
| 38 | 37 |
| 39 authority_label_->SetMultiLine(true); | 38 authority_label_->SetMultiLine(true); |
| 40 authority_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 39 authority_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 41 authority_label_->SetAllowCharacterBreak(true); | 40 authority_label_->SetAllowCharacterBreak(true); |
| 42 | 41 |
| 43 // Initialize the Grid Layout Manager used for this dialog box. | 42 // Initialize the Grid Layout Manager used for this dialog box. |
| 44 GridLayout* layout = layout_utils::CreatePanelLayout(this); | 43 GridLayout* layout = GridLayout::CreatePanel(this); |
| 45 | 44 |
| 46 // Add the column set for the information message at the top of the dialog | 45 // Add the column set for the information message at the top of the dialog |
| 47 // box. | 46 // box. |
| 48 const int single_column_view_set_id = 0; | 47 const int single_column_view_set_id = 0; |
| 49 views::ColumnSet* column_set = | 48 views::ColumnSet* column_set = |
| 50 layout->AddColumnSet(single_column_view_set_id); | 49 layout->AddColumnSet(single_column_view_set_id); |
| 51 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, | 50 column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, |
| 52 GridLayout::FIXED, kMessageWidth, 0); | 51 GridLayout::FIXED, kMessageWidth, 0); |
| 53 | 52 |
| 54 // Add the column set for the user name and password fields and labels. | 53 // Add the column set for the user name and password fields and labels. |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 144 |
| 146 void LoginView::OnLoginModelDestroying() { | 145 void LoginView::OnLoginModelDestroying() { |
| 147 login_model_->RemoveObserver(this); | 146 login_model_->RemoveObserver(this); |
| 148 login_model_ = NULL; | 147 login_model_ = NULL; |
| 149 } | 148 } |
| 150 | 149 |
| 151 const char* LoginView::GetClassName() const { | 150 const char* LoginView::GetClassName() const { |
| 152 return "LoginView"; | 151 return "LoginView"; |
| 153 } | 152 } |
| 154 | 153 |
| OLD | NEW |