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.
5 #ifndef CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_CREDENTIAL_ITEM_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_CREDENTIAL_ITEM_VIEW_H_
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"
13 class CredentialsItemView
;
14 class ManagePasswordsBubbleModel
;
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
{
32 // The caller is responsible for |password_form| lifetime.
33 ManageCredentialItemView(ManagePasswordsBubbleModel
* model
,
34 const autofill::PasswordForm
* password_form
);
35 ~ManageCredentialItemView() override
;
41 void ButtonPressed(views::Button
* sender
, const ui::Event
& event
) override
;
44 void LinkClicked(views::Link
* source
, int event_flags
) override
;
46 const autofill::PasswordForm
* const form_
;
47 scoped_ptr
<CredentialsItemView
> credential_button_
;
48 views::ImageButton
* delete_button_
;
49 views::Link
* undo_link_
;
51 ManagePasswordsBubbleModel
* const model_
;
54 DISALLOW_COPY_AND_ASSIGN(ManageCredentialItemView
);
57 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_CREDENTIAL_ITEM_VIEW_H_