Add ENABLE_MEDIA_ROUTER define to builds other than Android and iOS.
[chromium-blink-merge.git] / chrome / browser / ui / views / passwords / manage_credential_item_view.h
blob87dbe335c831debbd2089a736a99f48de15ecb01
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;
16 namespace autofill {
17 struct PasswordForm;
20 namespace views {
21 class ImageButton;
22 class Link;
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 // The caller is responsible for |password_form| lifetime.
33 ManageCredentialItemView(ManagePasswordsBubbleModel* model,
34 const autofill::PasswordForm* password_form);
35 ~ManageCredentialItemView() override;
37 private:
38 void Refresh();
40 // ButtonListener:
41 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
43 // LinkListener:
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_;
52 bool form_deleted_;
54 DISALLOW_COPY_AND_ASSIGN(ManageCredentialItemView);
57 #endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_CREDENTIAL_ITEM_VIEW_H_