OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_PASSWORDS_PASSWORD_DIALOG_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_PASSWORDS_PASSWORD_DIALOG_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_PASSWORDS_PASSWORD_DIALOG_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_PASSWORDS_PASSWORD_DIALOG_CONTROLLER_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <utility> | 9 #include <utility> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "components/password_manager/core/common/credential_manager_types.h" | 13 #include "components/password_manager/core/common/credential_manager_types.h" |
14 #include "ui/gfx/range/range.h" | 14 #include "ui/gfx/range/range.h" |
15 | 15 |
16 namespace autofill { | 16 namespace autofill { |
17 struct PasswordForm; | 17 struct PasswordForm; |
18 } | 18 } |
19 | 19 |
20 // An interface used by the password dialog (the account chooser) for setting | 20 // An interface used by the password dialog (the account chooser) for setting |
21 // and retrieving the state. | 21 // and retrieving the state. |
22 class PasswordDialogController { | 22 class PasswordDialogController { |
23 public: | 23 public: |
24 using FormsVector = std::vector<scoped_ptr<autofill::PasswordForm>>; | 24 using FormsVector = std::vector<std::unique_ptr<autofill::PasswordForm>>; |
25 | 25 |
26 // Returns forms from the password database for the current site. | 26 // Returns forms from the password database for the current site. |
27 virtual const FormsVector& GetLocalForms() const = 0; | 27 virtual const FormsVector& GetLocalForms() const = 0; |
28 | 28 |
29 // Returns IDP's forms which can be used for logging in. | 29 // Returns IDP's forms which can be used for logging in. |
30 virtual const FormsVector& GetFederationsForms() const = 0; | 30 virtual const FormsVector& GetFederationsForms() const = 0; |
31 | 31 |
32 // Returns a title of the account chooser and a range of the Smart Lock | 32 // Returns a title of the account chooser and a range of the Smart Lock |
33 // hyperlink if it exists. If the range is empty then no hyperlink is shown. | 33 // hyperlink if it exists. If the range is empty then no hyperlink is shown. |
34 virtual std::pair<base::string16, gfx::Range> GetAccoutChooserTitle() const | 34 virtual std::pair<base::string16, gfx::Range> GetAccoutChooserTitle() const |
(...skipping 22 matching lines...) Expand all Loading... |
57 | 57 |
58 // Called when the dialog was closed. | 58 // Called when the dialog was closed. |
59 virtual void OnCloseDialog() = 0; | 59 virtual void OnCloseDialog() = 0; |
60 | 60 |
61 protected: | 61 protected: |
62 virtual ~PasswordDialogController() = default; | 62 virtual ~PasswordDialogController() = default; |
63 }; | 63 }; |
64 | 64 |
65 | 65 |
66 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORD_DIALOG_CONTROLLER_H_ | 66 #endif // CHROME_BROWSER_UI_PASSWORDS_PASSWORD_DIALOG_CONTROLLER_H_ |
OLD | NEW |