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

Unified Diff: chrome/browser/ui/webui/uber/uber_ui.h

Issue 1012773010: cleanup: Use ExtensionRegistryObserver in Uber (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/uber/uber_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/uber/uber_ui.h
diff --git a/chrome/browser/ui/webui/uber/uber_ui.h b/chrome/browser/ui/webui/uber/uber_ui.h
index bbb3c70e5c040134ff342b6454adef0dde5516df..ca04098dd9f951d69cd64690a2695561c4bf9dd5 100644
--- a/chrome/browser/ui/webui/uber/uber_ui.h
+++ b/chrome/browser/ui/webui/uber/uber_ui.h
@@ -7,12 +7,18 @@
#include <string>
-#include "base/memory/scoped_vector.h"
+#include "base/scoped_observer.h"
#include "base/values.h"
-#include "chrome/browser/profiles/profile.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_ui_controller.h"
+#include "extensions/browser/extension_registry_observer.h"
+
+namespace content {
+class BrowserContext;
+}
+
+namespace extensions {
+class ExtensionRegistry;
+}
// The WebUI class for the uber page (chrome://chrome). It manages the UI for
// the uber page (navigation bar and so forth) as well as WebUI objects for
@@ -47,19 +53,24 @@ class UberUI : public content::WebUIController {
DISALLOW_COPY_AND_ASSIGN(UberUI);
};
-class UberFrameUI : public content::NotificationObserver,
- public content::WebUIController {
+class UberFrameUI : public content::WebUIController,
+ public extensions::ExtensionRegistryObserver {
public:
explicit UberFrameUI(content::WebUI* web_ui);
~UberFrameUI() override;
private:
- // content::NotificationObserver implementation.
- void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) override;
-
- content::NotificationRegistrar registrar_;
+ // extensions::ExtensionRegistryObserver implementation.
+ void OnExtensionLoaded(content::BrowserContext* browser_context,
+ const extensions::Extension* extension) override;
+ void OnExtensionUnloaded(
+ content::BrowserContext* browser_context,
+ const extensions::Extension* extension,
+ extensions::UnloadedExtensionInfo::Reason reason) override;
+
+ ScopedObserver<extensions::ExtensionRegistry,
+ extensions::ExtensionRegistryObserver>
+ extension_registry_observer_;
DISALLOW_COPY_AND_ASSIGN(UberFrameUI);
};
« no previous file with comments | « no previous file | chrome/browser/ui/webui/uber/uber_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698