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

Unified Diff: trunk/src/chrome/browser/ui/panels/panel.cc

Issue 409983002: Revert 284725 "Use ExtensionRegistryObserver instead of DEPRECAT..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 5 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 | « trunk/src/chrome/browser/ui/panels/panel.h ('k') | trunk/src/chrome/browser/ui/panels/panel_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/chrome/browser/ui/panels/panel.cc
===================================================================
--- trunk/src/chrome/browser/ui/panels/panel.cc (revision 284768)
+++ trunk/src/chrome/browser/ui/panels/panel.cc (working copy)
@@ -33,7 +33,6 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
-#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/image_loader.h"
#include "extensions/common/constants.h"
@@ -440,6 +439,11 @@
case content::NOTIFICATION_RENDER_VIEW_HOST_CHANGED:
ConfigureAutoResize(content::Source<content::WebContents>(source).ptr());
break;
+ case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED:
+ if (content::Details<extensions::UnloadedExtensionInfo>(
+ details)->extension->id() == extension_id())
+ Close();
+ break;
case chrome::NOTIFICATION_APP_TERMINATING:
Close();
break;
@@ -448,14 +452,6 @@
}
}
-void Panel::OnExtensionUnloaded(
- content::BrowserContext* browser_context,
- const extensions::Extension* extension,
- extensions::UnloadedExtensionInfo::Reason reason) {
- if (extension->id() == extension_id())
- Close();
-}
-
void Panel::OnTitlebarClicked(panel::ClickModifier modifier) {
if (collection_)
collection_->OnPanelTitlebarClicked(this, modifier);
@@ -536,8 +532,8 @@
native_panel_->AttachWebContents(web_contents);
// Close when the extension is unloaded or the browser is exiting.
- extension_registry_observer_.Add(
- extensions::ExtensionRegistry::Get(profile_));
+ registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
+ content::Source<Profile>(profile_));
registrar_.Add(this, chrome::NOTIFICATION_APP_TERMINATING,
content::NotificationService::AllSources());
registrar_.Add(this, chrome::NOTIFICATION_BROWSER_THEME_CHANGED,
@@ -819,7 +815,6 @@
attention_mode_(USE_PANEL_ATTENTION),
expansion_state_(EXPANDED),
command_updater_(this),
- extension_registry_observer_(this),
image_loader_ptr_factory_(this) {
}
« no previous file with comments | « trunk/src/chrome/browser/ui/panels/panel.h ('k') | trunk/src/chrome/browser/ui/panels/panel_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698