Chromium Code Reviews| Index: chrome/browser/extensions/api/passwords_private/passwords_private_event_router.h |
| diff --git a/chrome/browser/extensions/api/passwords_private/passwords_private_event_router.h b/chrome/browser/extensions/api/passwords_private/passwords_private_event_router.h |
| index 4923470ad77bf16d0d05c66cc454132f820758e0..650000bad35fba513c5c5851a84a5664e70444a5 100644 |
| --- a/chrome/browser/extensions/api/passwords_private/passwords_private_event_router.h |
| +++ b/chrome/browser/extensions/api/passwords_private/passwords_private_event_router.h |
| @@ -6,7 +6,7 @@ |
| #define CHROME_BROWSER_EXTENSIONS_API_PASSWORDS_PRIVATE_PASSWORDS_PRIVATE_EVENT_ROUTER_H_ |
| #include "base/macros.h" |
| -#include "chrome/browser/extensions/api/passwords_private/passwords_private_delegate.h" |
| +#include "chrome/common/extensions/api/passwords_private.h" |
| #include "components/keyed_service/core/keyed_service.h" |
| #include "extensions/browser/event_router.h" |
| @@ -21,13 +21,21 @@ namespace extensions { |
| // onPasswordExceptionsListChanged events of changes. |
| class PasswordsPrivateEventRouter : |
| public KeyedService, |
| - public EventRouter::Observer, |
| - public PasswordsPrivateDelegate::Observer { |
| + public EventRouter::Observer { |
| public: |
| static PasswordsPrivateEventRouter* Create( |
| content::BrowserContext* browser_context); |
| ~PasswordsPrivateEventRouter() override; |
| + void OnSavedPasswordsListChanged( |
| + const std::vector<api::passwords_private::PasswordUiEntry>& entries); |
| + void OnPasswordExceptionsListChanged( |
| + const std::vector<std::string>& exceptions); |
| + void OnPlaintextPasswordFetched( |
| + const std::string& origin_url, |
| + const std::string& username, |
| + const std::string& plaintext_password); |
|
stevenjb
2016/04/06 00:17:08
These should be commented.
hcarmona
2016/04/06 01:51:23
Done.
|
| + |
| protected: |
| explicit PasswordsPrivateEventRouter(content::BrowserContext* context); |
| @@ -36,25 +44,8 @@ class PasswordsPrivateEventRouter : |
| // EventRouter::Observer overrides: |
| void OnListenerAdded(const EventListenerInfo& details) override; |
| - void OnListenerRemoved(const EventListenerInfo& details) override; |
| - |
| - // PasswordsPrivateDelegate::Observer overrides: |
| - void OnSavedPasswordsListChanged( |
| - const std::vector<api::passwords_private::PasswordUiEntry>& entries) |
| - override; |
| - void OnPasswordExceptionsListChanged( |
| - const std::vector<std::string>& exceptions) override; |
| - void OnPlaintextPasswordFetched( |
| - const std::string& origin_url, |
| - const std::string& username, |
| - const std::string& plaintext_password) override; |
| private: |
| - // Either listens or unlistens for changes to saved passwords, password |
| - // exceptions, or the retrieval of plaintext passwords, depending on whether |
| - // clients are listening to the passwordsPrivate API events. |
| - void StartOrStopListeningForChanges(); |
| - |
| void SendSavedPasswordListToListeners(); |
| void SendPasswordExceptionListToListeners(); |
| @@ -67,12 +58,6 @@ class PasswordsPrivateEventRouter : |
| scoped_ptr<base::ListValue> cached_saved_password_parameters_; |
| scoped_ptr<base::ListValue> cached_password_exception_parameters_; |
| - // Whether this class is currently listening for changes to password changes. |
| - bool listening_; |
| - |
| - // True if we should ignore an update from PasswordsPrivateDelegate. |
| - bool ignore_updates_; |
| - |
| DISALLOW_COPY_AND_ASSIGN(PasswordsPrivateEventRouter); |
| }; |