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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORD_ITEM_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORD_ITEM_VIEW_H_
8 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h"
9 #include "components/autofill/core/common/password_form.h"
10 #include "ui/base/resource/resource_bundle.h"
16 // A custom view for credentials which allows the management of the specific
18 class ManagePasswordItemView
: public views::View
,
19 public views::ButtonListener
,
20 public views::LinkListener
{
22 ManagePasswordItemView(
23 ManagePasswordsBubbleModel
* manage_passwords_bubble_model
,
24 autofill::PasswordForm password_form
,
28 static base::string16
GetPasswordDisplayString(
29 const base::string16
& password
);
32 virtual ~ManagePasswordItemView();
34 // Changes the views according to the state of |delete_password_|.
37 // views::ButtonListener:
38 virtual void ButtonPressed(views::Button
* sender
,
39 const ui::Event
& event
) OVERRIDE
;
41 // views::LinkListener:
42 virtual void LinkClicked(views::Link
* source
, int event_flags
) OVERRIDE
;
44 views::Label
* label_1_
;
46 // This link is used to display the password dots when |delete_password_| is
47 // not set and to display an undo link if it is set. Clicking the undo link
48 // will change the view and unset |delete_password_|.
49 views::Link
* label_2_
;
51 // This button is used to set |delete_password_| and to bring up the the undo
53 views::LabelButton
* delete_button_
;
55 ManagePasswordsBubbleModel
* manage_passwords_bubble_model_
;
56 autofill::PasswordForm password_form_
;
57 bool delete_password_
;
61 DISALLOW_COPY_AND_ASSIGN(ManagePasswordItemView
);
64 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORD_ITEM_VIEW_H_