| 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 23 matching lines...) Expand all Loading... |
| 34 // Delegate used by the chrome.passwordsPrivate API to facilitate removing saved | 34 // Delegate used by the chrome.passwordsPrivate API to facilitate removing saved |
| 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. |
| 45 virtual const std::vector<api::passwords_private::PasswordUiEntry>* |
| 46 GetSavedPasswordsList() const = 0; |
| 47 |
| 44 // Sends the password exceptions list to the event router. | 48 // Sends the password exceptions list to the event router. |
| 45 virtual void SendPasswordExceptionsList() = 0; | 49 virtual void SendPasswordExceptionsList() = 0; |
| 46 | 50 |
| 51 // Gets the password exceptions list. |
| 52 virtual const std::vector<std::string>* GetPasswordExceptionsList() const = 0; |
| 53 |
| 47 // Removes the saved password entry corresponding to |origin_url| and | 54 // Removes the saved password entry corresponding to |origin_url| and |
| 48 // |username|. | 55 // |username|. |
| 49 // |origin_url| The human-readable origin for the URL where the password is | 56 // |origin_url| The human-readable origin for the URL where the password is |
| 50 // used/ should be obtained using GetHumanReadableOrigin(). | 57 // used/ should be obtained using GetHumanReadableOrigin(). |
| 51 // |username| The username used in conjunction with the saved password. | 58 // |username| The username used in conjunction with the saved password. |
| 52 virtual void RemoveSavedPassword( | 59 virtual void RemoveSavedPassword( |
| 53 const std::string& origin_url, const std::string& username) = 0; | 60 const std::string& origin_url, const std::string& username) = 0; |
| 54 | 61 |
| 55 // Removes the saved password exception entry corresponding to | 62 // Removes the saved password exception entry corresponding to |
| 56 // |exception_url|. | 63 // |exception_url|. |
| 57 // |exception_url| The URL corresponding to the exception to remove; should | 64 // |exception_url| The URL corresponding to the exception to remove; should |
| 58 // be obtained using GetHumanReadableOrigin(). | 65 // be obtained using GetHumanReadableOrigin(). |
| 59 virtual void RemovePasswordException(const std::string& exception_url) = 0; | 66 virtual void RemovePasswordException(const std::string& exception_url) = 0; |
| 60 | 67 |
| 61 // Requests the plain text password for entry corresponding to |origin_url| | 68 // Requests the plain text password for entry corresponding to |origin_url| |
| 62 // and |username|. | 69 // and |username|. |
| 63 // |origin_url| The human-readable origin for the URL where the password is | 70 // |origin_url| The human-readable origin for the URL where the password is |
| 64 // used; should be obtained using GetHumanReadableOrigin(). | 71 // used; should be obtained using GetHumanReadableOrigin(). |
| 65 // |username| The username used in conjunction with the saved password. | 72 // |username| The username used in conjunction with the saved password. |
| 66 // |native_window| The Chrome host window; will be used to show an OS-level | 73 // |native_window| The Chrome host window; will be used to show an OS-level |
| 67 // authentication dialog if necessary. | 74 // authentication dialog if necessary. |
| 68 virtual void RequestShowPassword(const std::string& origin_url, | 75 virtual void RequestShowPassword(const std::string& origin_url, |
| 69 const std::string& username, | 76 const std::string& username, |
| 70 content::WebContents* web_contents) = 0; | 77 content::WebContents* web_contents) = 0; |
| 71 }; | 78 }; |
| 72 | 79 |
| 73 } // namespace extensions | 80 } // namespace extensions |
| 74 | 81 |
| 75 #endif // CHROME_BROWSER_EXTENSIONS_API_PASSWORDS_PRIVATE_PASSWORDS_PRIVATE_DEL
EGATE_H_ | 82 #endif // CHROME_BROWSER_EXTENSIONS_API_PASSWORDS_PRIVATE_PASSWORDS_PRIVATE_DEL
EGATE_H_ |
| OLD | NEW |