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

Unified Diff: chrome/browser/extensions/api/log_private/log_private_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/log_private/log_private_api.h
diff --git a/chrome/browser/extensions/api/log_private/log_private_api.h b/chrome/browser/extensions/api/log_private/log_private_api.h
index 4b948aa65d30563bbe2c5668a81c4a7232e38a85..183a1a1630e4893913d9f77b64b3c931683259aa 100644
--- a/chrome/browser/extensions/api/log_private/log_private_api.h
+++ b/chrome/browser/extensions/api/log_private/log_private_api.h
@@ -8,26 +8,25 @@
#include <set>
#include <string>
+#include "base/scoped_observer.h"
#include "chrome/browser/extensions/api/log_private/filter_handler.h"
#include "chrome/browser/extensions/api/log_private/log_parser.h"
#include "chrome/browser/extensions/chrome_extension_function.h"
#include "chrome/browser/feedback/system_logs/about_system_logs_fetcher.h"
#include "chrome/common/extensions/api/log_private.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/extension_registry_observer.h"
#include "net/base/net_log.h"
-class Profile;
-
namespace content {
class BrowserContext;
}
namespace extensions {
+class ExtensionRegistry;
class LogPrivateAPI : public BrowserContextKeyedAPI,
- public content::NotificationObserver,
+ public ExtensionRegistryObserver,
public net::NetLog::ThreadSafeObserver {
public:
// Convenience method to get the LogPrivateAPI for a profile.
@@ -42,14 +41,15 @@ class LogPrivateAPI : public BrowserContextKeyedAPI,
// BrowserContextKeyedAPI implementation.
static BrowserContextKeyedAPIFactory<LogPrivateAPI>* GetFactoryInstance();
- // content::NotificationObserver implementation.
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
private:
friend class BrowserContextKeyedAPIFactory<LogPrivateAPI>;
+ // ExtensionRegistryObserver implementation.
+ virtual void OnExtensionUnloaded(
+ content::BrowserContext* browser_context,
+ const Extension* extension,
+ UnloadedExtensionInfo::Reason reason) OVERRIDE;
+
// ChromeNetLog::ThreadSafeObserver implementation:
virtual void OnAddEntry(const net::NetLog::Entry& entry) OVERRIDE;
@@ -67,11 +67,14 @@ class LogPrivateAPI : public BrowserContextKeyedAPI,
static const bool kServiceIsNULLWhileTesting = true;
static const bool kServiceRedirectedInIncognito = true;
- Profile* const profile_;
+ content::BrowserContext* const browser_context_;
bool logging_net_internals_;
- content::NotificationRegistrar registrar_;
std::set<std::string> net_internal_watches_;
scoped_ptr<base::ListValue> pending_entries_;
+
+ // Listen to extension unloaded notifications.
+ ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver>
+ extension_registry_observer_;
};
class LogPrivateGetHistoricalFunction : public AsyncExtensionFunction {

Powered by Google App Engine
This is Rietveld 408576698