Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5652)

Unified Diff: chrome/browser/extensions/api/passwords_private/passwords_private_event_router.h

Issue 1857513002: Update code so 1:1 relation between delegate and router is more clear. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};

Powered by Google App Engine
This is Rietveld 408576698