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

Unified Diff: chrome/browser/automation/automation_provider_observers.cc

Issue 11867023: content: remove NOTIFICATION_SAVE_PACKAGE_SUCCESSFULLY_FINISHED (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 11 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/automation/automation_provider_observers.cc
diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc
index 051bf68b8c2121fe289aebb338b99be0ed370e50..004398b83ce77ef6e2ffbf014b1638d34a51ec04 100644
--- a/chrome/browser/automation/automation_provider_observers.cc
+++ b/chrome/browser/automation/automation_provider_observers.cc
@@ -1707,31 +1707,31 @@ void OmniboxAcceptNotificationObserver::Observe(
}
SavePackageNotificationObserver::SavePackageNotificationObserver(
- DownloadManager* download_manager,
+ content::DownloadManager* download_manager,
AutomationProvider* automation,
IPC::Message* reply_message)
- : automation_(automation->AsWeakPtr()),
+ : download_manager_(download_manager),
+ automation_(automation->AsWeakPtr()),
reply_message_(reply_message) {
- content::Source<DownloadManager> source(download_manager);
- registrar_.Add(this, content::NOTIFICATION_SAVE_PACKAGE_SUCCESSFULLY_FINISHED,
- source);
+ download_manager_->AddObserver(this);
}
-SavePackageNotificationObserver::~SavePackageNotificationObserver() {}
+SavePackageNotificationObserver::~SavePackageNotificationObserver() {
+ download_manager_->RemoveObserver(this);
+}
-void SavePackageNotificationObserver::Observe(
- int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- if (type == content::NOTIFICATION_SAVE_PACKAGE_SUCCESSFULLY_FINISHED) {
- if (automation_) {
- AutomationJSONReply(automation_,
- reply_message_.release()).SendSuccess(NULL);
- }
- delete this;
- } else {
- NOTREACHED();
+void SavePackageNotificationObserver::OnSavePackageSuccessfullyFinished(
+ content::DownloadManager* manager, content::DownloadItem* item) {
+ if (automation_) {
+ AutomationJSONReply(automation_,
+ reply_message_.release()).SendSuccess(NULL);
}
+ delete this;
+}
+
+void SavePackageNotificationObserver::ManagerGoingDown(
+ content::DownloadManager* manager) {
+ delete this;
}
PageSnapshotTaker::PageSnapshotTaker(AutomationProvider* automation,
« no previous file with comments | « chrome/browser/automation/automation_provider_observers.h ('k') | chrome/browser/browser_encoding_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698