Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / views / passwords / manage_password_item_view.h
blobd53c486a46b92676a6446436e262c2615335341a
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"
12 namespace views {
13 class LabelButton;
16 // A custom view for credentials which allows the management of the specific
17 // credentials.
18 class ManagePasswordItemView : public views::View,
19 public views::ButtonListener,
20 public views::LinkListener {
21 public:
22 ManagePasswordItemView(
23 ManagePasswordsBubbleModel* manage_passwords_bubble_model,
24 autofill::PasswordForm password_form,
25 int field_1_width,
26 int field_2_width);
28 static base::string16 GetPasswordDisplayString(
29 const base::string16& password);
31 private:
32 virtual ~ManagePasswordItemView();
34 // Changes the views according to the state of |delete_password_|.
35 void Refresh();
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
52 // link in |label_2|.
53 views::LabelButton* delete_button_;
55 ManagePasswordsBubbleModel* manage_passwords_bubble_model_;
56 autofill::PasswordForm password_form_;
57 bool delete_password_;
58 int field_1_width_;
59 int field_2_width_;
61 DISALLOW_COPY_AND_ASSIGN(ManagePasswordItemView);
64 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORD_ITEM_VIEW_H_