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

Unified Diff: chrome/browser/extensions/api/input_ime/input_ime_api.h

Issue 259843004: Remove some NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED from c/b/extensions Part2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comment Created 6 years, 8 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/input_ime/input_ime_api.h
diff --git a/chrome/browser/extensions/api/input_ime/input_ime_api.h b/chrome/browser/extensions/api/input_ime/input_ime_api.h
index 9bce8fc061827c339ca46659280fd2ebf3e8127a..176596819b2586ca2e736e37616b79a76aa2870d 100644
--- a/chrome/browser/extensions/api/input_ime/input_ime_api.h
+++ b/chrome/browser/extensions/api/input_ime/input_ime_api.h
@@ -10,15 +10,15 @@
#include <vector>
#include "base/memory/singleton.h"
+#include "base/scoped_observer.h"
#include "base/values.h"
#include "chrome/browser/chromeos/input_method/input_method_engine_interface.h"
#include "chrome/browser/profiles/profile.h"
#include "components/keyed_service/core/keyed_service.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_function.h"
+#include "extensions/browser/extension_registry_observer.h"
#include "extensions/common/extension.h"
class Profile;
@@ -29,6 +29,7 @@ class ImeObserver;
} // namespace chromeos
namespace extensions {
+class ExtensionRegistry;
struct InputComponentInfo;
class InputImeEventRouter {
@@ -219,7 +220,7 @@ class InputImeHideInputViewFunction : public AsyncExtensionFunction {
};
class InputImeAPI : public BrowserContextKeyedAPI,
- public content::NotificationObserver,
+ public ExtensionRegistryObserver,
public EventRouter::Observer {
public:
explicit InputImeAPI(content::BrowserContext* context);
@@ -228,10 +229,13 @@ class InputImeAPI : public BrowserContextKeyedAPI,
// BrowserContextKeyedAPI implementation.
static BrowserContextKeyedAPIFactory<InputImeAPI>* GetFactoryInstance();
- // content::NotificationObserver implementation.
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
+ // ExtensionRegistryObserver implementation.
+ virtual void OnExtensionLoaded(content::BrowserContext* browser_context,
+ const Extension* extension) OVERRIDE;
+ virtual void OnExtensionUnloaded(
+ content::BrowserContext* browser_context,
+ const Extension* extension,
+ UnloadedExtensionInfo::Reason reason) OVERRIDE;
// EventRouter::Observer implementation.
virtual void OnListenerAdded(const EventListenerInfo& details) OVERRIDE;
@@ -246,8 +250,11 @@ class InputImeAPI : public BrowserContextKeyedAPI,
}
static const bool kServiceIsNULLWhileTesting = true;
- Profile* const profile_;
- content::NotificationRegistrar registrar_;
+ content::BrowserContext* const browser_context_;
+
+ // Listen to extension load, unloaded notifications.
+ ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
+ extension_registry_observer_;
};
} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/active_tab_unittest.cc ('k') | chrome/browser/extensions/api/input_ime/input_ime_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698