Chromium Code Reviews| Index: chrome/browser/extensions/api/downloads/downloads_api.h |
| diff --git a/chrome/browser/extensions/api/downloads/downloads_api.h b/chrome/browser/extensions/api/downloads/downloads_api.h |
| index acf9ac8a4f917fe837565baa043185551017ed01..8326f94695c3039fa6bbbc831f7b1b9cc54ae016 100644 |
| --- a/chrome/browser/extensions/api/downloads/downloads_api.h |
| +++ b/chrome/browser/extensions/api/downloads/downloads_api.h |
| @@ -10,6 +10,7 @@ |
| #include "base/files/file_path.h" |
| #include "base/memory/singleton.h" |
| +#include "base/scoped_observer.h" |
| #include "base/strings/string16.h" |
| #include "base/values.h" |
| #include "chrome/browser/download/all_download_item_notifier.h" |
| @@ -23,6 +24,7 @@ |
| #include "content/public/browser/notification_observer.h" |
| #include "content/public/browser/notification_registrar.h" |
|
not at google - send to devlin
2014/04/24 17:43:41
you can delete these #includes
limasdf
2014/04/24 18:27:47
Done. not only here but also others.
|
| #include "extensions/browser/event_router.h" |
| +#include "extensions/browser/extension_registry_observer.h" |
| class DownloadFileIconExtractor; |
| class DownloadQuery; |
| @@ -32,6 +34,10 @@ class ResourceContext; |
| class ResourceDispatcherHost; |
| } |
| +namespace extensions { |
| +class ExtensionRegistry; |
| +} |
| + |
| // Functions in the chrome.downloads namespace facilitate |
| // controlling downloads from extensions. See the full API doc at |
| // http://goo.gl/6hO1n |
| @@ -296,9 +302,10 @@ class DownloadsGetFileIconFunction : public ChromeAsyncExtensionFunction { |
| // Observes a single DownloadManager and many DownloadItems and dispatches |
| // onCreated and onErased events. |
| -class ExtensionDownloadsEventRouter : public extensions::EventRouter::Observer, |
| - public content::NotificationObserver, |
| - public AllDownloadItemNotifier::Observer { |
| +class ExtensionDownloadsEventRouter |
| + : public extensions::EventRouter::Observer, |
| + public extensions::ExtensionRegistryObserver, |
| + public AllDownloadItemNotifier::Observer { |
| public: |
| typedef base::Callback<void( |
| const base::FilePath& changed_filename, |
| @@ -383,15 +390,18 @@ class ExtensionDownloadsEventRouter : public extensions::EventRouter::Observer, |
| const extensions::Event::WillDispatchCallback& will_dispatch_callback, |
| base::Value* json_arg); |
| - // content::NotificationObserver |
| - virtual void Observe(int type, |
| - const content::NotificationSource& source, |
| - const content::NotificationDetails& details) OVERRIDE; |
| + virtual void OnExtensionUnloaded( |
|
benjhayden
2014/04/24 17:38:48
// extensions::ExtensionRegistryObserver
limasdf
2014/04/24 18:27:47
Done.
|
| + content::BrowserContext* browser_context, |
| + const extensions::Extension* extension, |
| + extensions::UnloadedExtensionInfo::Reason reason) OVERRIDE; |
| Profile* profile_; |
| AllDownloadItemNotifier notifier_; |
| std::set<const extensions::Extension*> shelf_disabling_extensions_; |
| - content::NotificationRegistrar registrar_; |
| + |
| + ScopedObserver<extensions::ExtensionRegistry, |
| + extensions::ExtensionRegistryObserver> |
| + scoped_extension_registry_observer_; |
|
not at google - send to devlin
2014/04/24 17:43:41
no scoped_
limasdf
2014/04/24 18:27:47
Done. my bad
|
| DISALLOW_COPY_AND_ASSIGN(ExtensionDownloadsEventRouter); |
| }; |