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 "components/autofill/core/common/password_form.h"
11 #include "ui/views/controls/button/button.h"
12 #include "ui/views/controls/link_listener.h"
14 class CredentialsItemView
;
15 class ManagePasswordsBubbleModel
;
22 // A custom view that represents one credential row. There are two states:
23 // * Present a credential to the user for management.
24 // * Offer the user the ability to undo a deletion action.
25 class ManageCredentialItemView
: public views::View
,
26 public views::ButtonListener
,
27 public views::LinkListener
{
29 ManageCredentialItemView(ManagePasswordsBubbleModel
* model
,
30 const autofill::PasswordForm
* password_form
);
31 ~ManageCredentialItemView() override
;
37 void ButtonPressed(views::Button
* sender
, const ui::Event
& event
) override
;
40 void LinkClicked(views::Link
* source
, int event_flags
) override
;
42 autofill::PasswordForm form_
;
43 scoped_ptr
<CredentialsItemView
> credential_button_
;
44 views::ImageButton
* delete_button_
;
45 views::Link
* undo_link_
;
47 ManagePasswordsBubbleModel
* const model_
;
50 DISALLOW_COPY_AND_ASSIGN(ManageCredentialItemView
);
53 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_CREDENTIAL_ITEM_VIEW_H_