Home | History | Annotate | Download | only in passwords
      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.
      4 
      5 #ifndef CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORD_ITEM_VIEW_H_
      6 #define CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORD_ITEM_VIEW_H_
      7 
      8 #include "components/autofill/core/common/password_form.h"
      9 #include "components/password_manager/core/common/password_manager_ui.h"
     10 #include "ui/views/view.h"
     11 
     12 class ManagePasswordsBubbleModel;
     13 
     14 // A custom view for credentials which allows the management of the specific
     15 // credentials. The view has three distinct states:
     16 //
     17 // * Present credentials to the user which she may choose to save.
     18 // * Present already-saved credentials to the user for management.
     19 // * Offer the user the ability to undo a deletion action.
     20 //
     21 // The ManagePasswordItemView serves as a container for a single view
     22 // representing one of these states.
     23 class ManagePasswordItemView : public views::View {
     24  public:
     25   ManagePasswordItemView(
     26       ManagePasswordsBubbleModel* manage_passwords_bubble_model,
     27       const autofill::PasswordForm& password_form,
     28       password_manager::ui::PasswordItemPosition position);
     29 
     30  private:
     31   class ManageView;
     32   class PendingView;
     33   class UndoView;
     34 
     35   virtual ~ManagePasswordItemView();
     36 
     37   void NotifyClickedDelete();
     38   void NotifyClickedUndo();
     39 
     40   // Changes the views according to the state of |delete_password_|.
     41   void Refresh();
     42 
     43   ManagePasswordsBubbleModel* model_;
     44   autofill::PasswordForm password_form_;
     45   bool delete_password_;
     46 
     47   DISALLOW_COPY_AND_ASSIGN(ManagePasswordItemView);
     48 };
     49 
     50 #endif  // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORD_ITEM_VIEW_H_
     51