Chromium Code Reviews| 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_EXTENSIONS_API_PASSWORDS_PRIVATE_PASSWORDS_PRIVATE_DELEGA TE_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_PASSWORDS_PRIVATE_PASSWORDS_PRIVATE_DELEGA TE_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_PASSWORDS_PRIVATE_PASSWORDS_PRIVATE_DELEGA TE_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_API_PASSWORDS_PRIVATE_PASSWORDS_PRIVATE_DELEGA TE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 // passwords and password exceptions and to notify listeners when these values | 35 // passwords and password exceptions and to notify listeners when these values |
| 36 // have changed. | 36 // have changed. |
| 37 class PasswordsPrivateDelegate : public KeyedService { | 37 class PasswordsPrivateDelegate : public KeyedService { |
| 38 public: | 38 public: |
| 39 ~PasswordsPrivateDelegate() override {} | 39 ~PasswordsPrivateDelegate() override {} |
| 40 | 40 |
| 41 // Sends the saved passwords list to the event router. | 41 // Sends the saved passwords list to the event router. |
| 42 virtual void SendSavedPasswordsList() = 0; | 42 virtual void SendSavedPasswordsList() = 0; |
| 43 | 43 |
| 44 // Gets the saved passwords list. | 44 // Gets the saved passwords list. |
| 45 virtual const std::vector<api::passwords_private::PasswordUiEntry>* | 45 using UiEntries = std::vector<api::passwords_private::PasswordUiEntry>; |
| 46 GetSavedPasswordsList() const = 0; | 46 using UiEntriesCallback = base::Callback<void(const UiEntries*)>; |
|
Devlin
2016/11/01 00:09:57
Why pass this as a const UiEntries* instead of con
Dan Beam
2016/11/01 21:08:25
Done.
| |
| 47 virtual void GetSavedPasswordsList(const UiEntriesCallback& callback) = 0; | |
| 47 | 48 |
| 48 // Sends the password exceptions list to the event router. | 49 // Sends the password exceptions list to the event router. |
| 49 virtual void SendPasswordExceptionsList() = 0; | 50 virtual void SendPasswordExceptionsList() = 0; |
| 50 | 51 |
| 51 // Gets the password exceptions list. | 52 // Gets the password exceptions list. |
| 52 virtual const std::vector<api::passwords_private::ExceptionPair>* | 53 using ExceptionPairs = std::vector<api::passwords_private::ExceptionPair>; |
| 53 GetPasswordExceptionsList() const = 0; | 54 using ExceptionPairsCallback = base::Callback<void(const ExceptionPairs*)>; |
| 55 virtual void GetPasswordExceptionsList( | |
| 56 const ExceptionPairsCallback& callback) = 0; | |
| 54 | 57 |
| 55 // Removes the saved password entry corresponding to |origin_url| and | 58 // Removes the saved password entry corresponding to |origin_url| and |
| 56 // |username|. | 59 // |username|. |
| 57 // |origin_url| The human-readable origin for the URL where the password is | 60 // |origin_url| The human-readable origin for the URL where the password is |
| 58 // used/ should be obtained using GetHumanReadableOrigin(). | 61 // used/ should be obtained using GetHumanReadableOrigin(). |
| 59 // |username| The username used in conjunction with the saved password. | 62 // |username| The username used in conjunction with the saved password. |
| 60 virtual void RemoveSavedPassword( | 63 virtual void RemoveSavedPassword( |
| 61 const std::string& origin_url, const std::string& username) = 0; | 64 const std::string& origin_url, const std::string& username) = 0; |
| 62 | 65 |
| 63 // Removes the saved password exception entry corresponding to | 66 // Removes the saved password exception entry corresponding to |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 74 // |native_window| The Chrome host window; will be used to show an OS-level | 77 // |native_window| The Chrome host window; will be used to show an OS-level |
| 75 // authentication dialog if necessary. | 78 // authentication dialog if necessary. |
| 76 virtual void RequestShowPassword(const std::string& origin_url, | 79 virtual void RequestShowPassword(const std::string& origin_url, |
| 77 const std::string& username, | 80 const std::string& username, |
| 78 content::WebContents* web_contents) = 0; | 81 content::WebContents* web_contents) = 0; |
| 79 }; | 82 }; |
| 80 | 83 |
| 81 } // namespace extensions | 84 } // namespace extensions |
| 82 | 85 |
| 83 #endif // CHROME_BROWSER_EXTENSIONS_API_PASSWORDS_PRIVATE_PASSWORDS_PRIVATE_DEL EGATE_H_ | 86 #endif // CHROME_BROWSER_EXTENSIONS_API_PASSWORDS_PRIVATE_PASSWORDS_PRIVATE_DEL EGATE_H_ |
| OLD | NEW |