| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/passwords/manage_password_items_view.h" | 5 #include "chrome/browser/ui/views/passwords/manage_password_items_view.h" |
| 6 | 6 |
| 7 #include <numeric> | 7 #include <numeric> |
| 8 | 8 |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" | 10 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 return std::accumulate(row_views, row_views + arraysize(row_views), 0, | 200 return std::accumulate(row_views, row_views + arraysize(row_views), 0, |
| 201 [](int max_height, const views::View* view) { | 201 [](int max_height, const views::View* view) { |
| 202 return std::max(max_height, view->GetPreferredSize().height()); | 202 return std::max(max_height, view->GetPreferredSize().height()); |
| 203 }); | 203 }); |
| 204 } | 204 } |
| 205 | 205 |
| 206 void ManagePasswordItemsView::PasswordFormRow::AddCredentialsRow( | 206 void ManagePasswordItemsView::PasswordFormRow::AddCredentialsRow( |
| 207 views::GridLayout* layout) { | 207 views::GridLayout* layout) { |
| 208 ResetControls(); | 208 ResetControls(); |
| 209 int column_set_id = | 209 int column_set_id = |
| 210 host_->model_->state() == password_manager::ui::PENDING_PASSWORD_STATE | 210 host_->model_->state() == password_manager::ui::MANAGE_STATE |
| 211 ? TWO_COLUMN_SET | 211 ? THREE_COLUMN_SET |
| 212 : THREE_COLUMN_SET; | 212 : TWO_COLUMN_SET; |
| 213 BuildColumnSetIfNeeded(layout, column_set_id); | 213 BuildColumnSetIfNeeded(layout, column_set_id); |
| 214 layout->StartRowWithPadding(0, column_set_id, 0, | 214 layout->StartRowWithPadding(0, column_set_id, 0, |
| 215 views::kRelatedControlVerticalSpacing); | 215 views::kRelatedControlVerticalSpacing); |
| 216 layout->AddView(GenerateUsernameLabel(*password_form_).release(), 1, 1, | 216 layout->AddView(GenerateUsernameLabel(*password_form_).release(), 1, 1, |
| 217 views::GridLayout::FILL, views::GridLayout::FILL, | 217 views::GridLayout::FILL, views::GridLayout::FILL, |
| 218 0, fixed_height_); | 218 0, fixed_height_); |
| 219 layout->AddView(GeneratePasswordLabel(*password_form_).release(), 1, 1, | 219 layout->AddView(GeneratePasswordLabel(*password_form_).release(), 1, 1, |
| 220 views::GridLayout::FILL, views::GridLayout::FILL, | 220 views::GridLayout::FILL, views::GridLayout::FILL, |
| 221 0, fixed_height_); | 221 0, fixed_height_); |
| 222 if (column_set_id == THREE_COLUMN_SET) { | 222 if (column_set_id == THREE_COLUMN_SET) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 deleted | 296 deleted |
| 297 ? ManagePasswordsBubbleModel::REMOVE_PASSWORD | 297 ? ManagePasswordsBubbleModel::REMOVE_PASSWORD |
| 298 : ManagePasswordsBubbleModel::ADD_PASSWORD); | 298 : ManagePasswordsBubbleModel::ADD_PASSWORD); |
| 299 } | 299 } |
| 300 | 300 |
| 301 void ManagePasswordItemsView::Refresh() { | 301 void ManagePasswordItemsView::Refresh() { |
| 302 DCHECK_NE(password_manager::ui::PENDING_PASSWORD_STATE, model_->state()); | 302 DCHECK_NE(password_manager::ui::PENDING_PASSWORD_STATE, model_->state()); |
| 303 RemoveAllChildViews(true); | 303 RemoveAllChildViews(true); |
| 304 AddRows(); | 304 AddRows(); |
| 305 } | 305 } |
| OLD | NEW |