1 // Copyright 2014 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_PASSWORDS_PASSWORD_GENERATION_POPUP_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_PASSWORDS_PASSWORD_GENERATION_POPUP_CONTROLLER_H_
7 
8 #include "base/strings/string16.h"
9 #include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h"
10 
11 class PasswordGenerationPopupController
12     : public autofill::AutofillPopupViewDelegate {
13  public:
14   enum GenerationUIState {
15     // Generated password is offered in the popup but not filled yet.
16     kOfferGeneration,
17     // The generated password was accepted.
18     kEditGeneratedPassword,
19   };
20 
21   // Called by the view when the password was accepted.
22   virtual void PasswordAccepted() = 0;
23 
24   // Called by the view when the password was selected.
25   virtual void SetSelected() = 0;
26 
27   // Accessors
28   virtual GenerationUIState state() const = 0;
29   virtual bool password_selected() const = 0;
30   virtual const base::string16& password() const = 0;
31 
32   // Translated strings
33   virtual base::string16 SuggestedText() = 0;
34   virtual const base::string16& HelpText() = 0;
35 
36  protected:
37   ~PasswordGenerationPopupController() override = default;
38 };
39 
40 #endif  // CHROME_BROWSER_UI_PASSWORDS_PASSWORD_GENERATION_POPUP_CONTROLLER_H_
41