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

Unified Diff: extensions/test/extension_test_notification_observer.cc

Issue 2753513006: Remove ...LOADED_DEPRECATED and its friends (Closed)
Patch Set: include .h Created 3 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
« no previous file with comments | « extensions/test/extension_test_notification_observer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/test/extension_test_notification_observer.cc
diff --git a/extensions/test/extension_test_notification_observer.cc b/extensions/test/extension_test_notification_observer.cc
index 7d6db8079ff890d6bee9122c62423b9ae8638e66..3d2f23fa418d520841d62150be37c533f5bd4465 100644
--- a/extensions/test/extension_test_notification_observer.cc
+++ b/extensions/test/extension_test_notification_observer.cc
@@ -74,7 +74,11 @@ ExtensionTestNotificationObserver::ExtensionTestNotificationObserver(
: context_(context),
extension_installs_observed_(0),
extension_load_errors_observed_(0),
- crx_installers_done_observed_(0) {}
+ crx_installers_done_observed_(0),
+ registry_observer_(this) {
+ if (context_)
+ registry_observer_.Add(ExtensionRegistry::Get(context_));
+}
ExtensionTestNotificationObserver::~ExtensionTestNotificationObserver() {}
@@ -100,10 +104,6 @@ bool ExtensionTestNotificationObserver::WaitForExtensionInstallError() {
return extension_installs_observed_ == before;
}
-void ExtensionTestNotificationObserver::WaitForExtensionLoad() {
- WaitForNotification(NOTIFICATION_EXTENSION_LOADED_DEPRECATED);
-}
-
bool ExtensionTestNotificationObserver::WaitForExtensionLoadError() {
int before = extension_load_errors_observed_;
WaitForNotification(NOTIFICATION_EXTENSION_LOAD_ERROR);
@@ -151,12 +151,6 @@ void ExtensionTestNotificationObserver::Observe(
const content::NotificationSource& source,
const content::NotificationDetails& details) {
switch (type) {
- case NOTIFICATION_EXTENSION_LOADED_DEPRECATED:
- last_loaded_extension_id_ =
- content::Details<const Extension>(details).ptr()->id();
- VLOG(1) << "Got EXTENSION_LOADED notification.";
- break;
-
case NOTIFICATION_CRX_INSTALLER_DONE:
VLOG(1) << "Got CRX_INSTALLER_DONE notification.";
{
@@ -181,6 +175,18 @@ void ExtensionTestNotificationObserver::Observe(
}
}
+void ExtensionTestNotificationObserver::OnExtensionLoaded(
+ content::BrowserContext* browser_context,
+ const Extension* extension) {
+ last_loaded_extension_id_ = extension->id();
+ VLOG(1) << "Got EXTENSION_LOADED notification.";
+}
+
+void ExtensionTestNotificationObserver::OnShutdown(
+ ExtensionRegistry* registry) {
+ registry_observer_.RemoveAll();
+}
+
void ExtensionTestNotificationObserver::WaitForCondition(
const ConditionCallback& condition,
NotificationSet* notification_set) {
« no previous file with comments | « extensions/test/extension_test_notification_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698