| 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_item_view.h" | 5 #include "chrome/browser/ui/views/passwords/manage_password_item_view.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" | 7 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" |
| 8 #include "components/password_manager/core/common/password_manager_ui.h" | 8 #include "components/password_manager/core/common/password_manager_ui.h" |
| 9 #include "grit/generated_resources.h" | 9 #include "grit/generated_resources.h" |
| 10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 parent_->NotifyClickedUndo(); | 187 parent_->NotifyClickedUndo(); |
| 188 } | 188 } |
| 189 | 189 |
| 190 ManagePasswordItemView::UndoView::~UndoView() { | 190 ManagePasswordItemView::UndoView::~UndoView() { |
| 191 } | 191 } |
| 192 | 192 |
| 193 // ManagePasswordItemView | 193 // ManagePasswordItemView |
| 194 ManagePasswordItemView::ManagePasswordItemView( | 194 ManagePasswordItemView::ManagePasswordItemView( |
| 195 ManagePasswordsBubbleModel* manage_passwords_bubble_model, | 195 ManagePasswordsBubbleModel* manage_passwords_bubble_model, |
| 196 autofill::PasswordForm password_form, | 196 autofill::PasswordForm password_form, |
| 197 Position position) | 197 password_manager::ui::PasswordItemPosition position) |
| 198 : model_(manage_passwords_bubble_model), | 198 : model_(manage_passwords_bubble_model), |
| 199 password_form_(password_form), | 199 password_form_(password_form), |
| 200 delete_password_(false) { | 200 delete_password_(false) { |
| 201 views::FillLayout* layout = new views::FillLayout(); | 201 views::FillLayout* layout = new views::FillLayout(); |
| 202 SetLayoutManager(layout); | 202 SetLayoutManager(layout); |
| 203 | 203 |
| 204 // When a password is displayed as the first item in a list, it has borders | 204 // When a password is displayed as the first item in a list, it has borders |
| 205 // on both the top and bottom. When it's in the middle of a list, or at the | 205 // on both the top and bottom. When it's in the middle of a list, or at the |
| 206 // end, it has a border only on the bottom. | 206 // end, it has a border only on the bottom. |
| 207 SetBorder(views::Border::CreateSolidSidedBorder( | 207 SetBorder(views::Border::CreateSolidSidedBorder( |
| 208 position == FIRST_ITEM ? 1 : 0, | 208 position == password_manager::ui::FIRST_ITEM ? 1 : 0, |
| 209 0, | 209 0, |
| 210 1, | 210 1, |
| 211 0, | 211 0, |
| 212 GetNativeTheme()->GetSystemColor( | 212 GetNativeTheme()->GetSystemColor( |
| 213 ui::NativeTheme::kColorId_EnabledMenuButtonBorderColor))); | 213 ui::NativeTheme::kColorId_EnabledMenuButtonBorderColor))); |
| 214 | 214 |
| 215 if (password_manager::ui::IsPendingState(model_->state())) { | 215 if (password_manager::ui::IsPendingState(model_->state())) { |
| 216 AddChildView(new PendingView(this)); | 216 AddChildView(new PendingView(this)); |
| 217 } else { | 217 } else { |
| 218 AddChildView(new ManageView(this)); | 218 AddChildView(new ManageView(this)); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 243 | 243 |
| 244 void ManagePasswordItemView::NotifyClickedDelete() { | 244 void ManagePasswordItemView::NotifyClickedDelete() { |
| 245 delete_password_ = true; | 245 delete_password_ = true; |
| 246 Refresh(); | 246 Refresh(); |
| 247 } | 247 } |
| 248 | 248 |
| 249 void ManagePasswordItemView::NotifyClickedUndo() { | 249 void ManagePasswordItemView::NotifyClickedUndo() { |
| 250 delete_password_ = false; | 250 delete_password_ = false; |
| 251 Refresh(); | 251 Refresh(); |
| 252 } | 252 } |
| OLD | NEW |