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

Unified Diff: chrome/browser/media_galleries/media_scan_manager.h

Issue 207613002: Cleanup: Remove NOTIFICATION_EXTENSION_UNLOADED usage in MediaScanManager. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase, add error console 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/media_galleries/media_scan_manager.h
===================================================================
--- chrome/browser/media_galleries/media_scan_manager.h (revision 260931)
+++ chrome/browser/media_galleries/media_scan_manager.h (working copy)
@@ -13,24 +13,25 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "base/scoped_observer.h"
#include "base/time/time.h"
#include "chrome/browser/media_galleries/media_folder_finder.h"
#include "chrome/browser/media_galleries/media_scan_types.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
+#include "extensions/browser/extension_registry_observer.h"
+class MediaScanManagerObserver;
class Profile;
-class MediaScanManagerObserver;
namespace extensions {
class Extension;
-} // namespace extensions
+class ExtensionRegistry;
+}
// The MediaScanManager is owned by MediaFileSystemRegistry, which is global.
// This class manages multiple 'virtual' media scans, up to one per extension
// per profile, and also manages the one physical scan backing them.
// This class lives and is called on the UI thread.
-class MediaScanManager : public content::NotificationObserver {
+class MediaScanManager : public extensions::ExtensionRegistryObserver {
public:
MediaScanManager();
virtual ~MediaScanManager();
@@ -68,10 +69,10 @@
};
typedef std::map<Profile*, ScanObservers> ScanObserverMap;
- // content::NotificationObserver implementation.
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
+ // extensions::ExtensionRegistryObserver implementation.
+ virtual void OnExtensionUnloaded(
+ content::BrowserContext* browser_context,
+ const extensions::Extension* extension) OVERRIDE;
bool ScanInProgress() const;
@@ -93,8 +94,9 @@
// Set of extensions (on all profiles) that have an in-progress scan.
ScanObserverMap observers_;
- // Used to listen for NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED events.
- content::NotificationRegistrar registrar_;
+ ScopedObserver<extensions::ExtensionRegistry,
+ extensions::ExtensionRegistryObserver>
+ scoped_extension_registry_observer_;
base::WeakPtrFactory<MediaScanManager> weak_factory_;
« no previous file with comments | « chrome/browser/extensions/error_console/error_console.cc ('k') | chrome/browser/media_galleries/media_scan_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698