OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_CREDENTIAL_ITEM_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_CREDENTIAL_ITEM_VIEW_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "ui/views/controls/button/button.h" |
| 11 #include "ui/views/controls/link_listener.h" |
| 12 |
| 13 class CredentialsItemView; |
| 14 class ManagePasswordsBubbleModel; |
| 15 |
| 16 namespace autofill { |
| 17 struct PasswordForm; |
| 18 } |
| 19 |
| 20 namespace views { |
| 21 class ImageButton; |
| 22 class Link; |
| 23 } |
| 24 |
| 25 // A custom view that represents one credential row. There are two states: |
| 26 // * Present a credential to the user for management. |
| 27 // * Offer the user the ability to undo a deletion action. |
| 28 class ManageCredentialItemView : public views::View, |
| 29 public views::ButtonListener, |
| 30 public views::LinkListener { |
| 31 public: |
| 32 ManageCredentialItemView(ManagePasswordsBubbleModel* model, |
| 33 const autofill::PasswordForm* password_form); |
| 34 ~ManageCredentialItemView() override; |
| 35 |
| 36 private: |
| 37 void Refresh(); |
| 38 |
| 39 // ButtonListener: |
| 40 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 41 |
| 42 // LinkListener: |
| 43 void LinkClicked(views::Link* source, int event_flags) override; |
| 44 |
| 45 scoped_ptr<CredentialsItemView> credential_button_; |
| 46 views::ImageButton* delete_button_; |
| 47 views::Link* undo_link_; |
| 48 |
| 49 ManagePasswordsBubbleModel* const model_; |
| 50 bool form_deleted_; |
| 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(ManageCredentialItemView); |
| 53 }; |
| 54 |
| 55 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_CREDENTIAL_ITEM_VIEW_H_ |
OLD | NEW |