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

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

Issue 11711003: Remove the DownloadItem::TogglePause() interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/testing_automation_provider.cc
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index 29ea238304a548ee5a82ee17c6af2e0bd62bf3de..f3cd0c08c40388cd5fbef474a8460df339920336 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -2657,7 +2657,7 @@ void TestingAutomationProvider::PerformActionOnDownload(
}
// We need to be IN_PROGRESS for these actions.
- if ((action == "toggle_pause" || action == "cancel") &&
+ if ((action == "pause" || action == "resume" || action == "cancel") &&
!selected_item->IsInProgress()) {
AutomationJSONReply(this, reply_message)
.SendError("Selected DownloadItem is not in progress.");
@@ -2689,11 +2689,16 @@ void TestingAutomationProvider::PerformActionOnDownload(
selected_item->AddObserver(new AutomationProviderDownloadUpdatedObserver(
this, reply_message, false, browser->profile()->IsOffTheRecord()));
selected_item->DangerousDownloadValidated();
- } else if (action == "toggle_pause") {
+ } else if (action == "pause") {
selected_item->AddObserver(new AutomationProviderDownloadUpdatedObserver(
this, reply_message, false, browser->profile()->IsOffTheRecord()));
// This will still return if download has already completed.
- selected_item->TogglePause();
+ selected_item->Pause();
+ } else if (action == "resume") {
+ selected_item->AddObserver(new AutomationProviderDownloadUpdatedObserver(
+ this, reply_message, false, browser->profile()->IsOffTheRecord()));
+ // This will still return if download has already completed.
asanka 2013/01/02 16:44:50 I'm not very familiar with the automation interfac
Randy Smith (Not in Mondays) 2013/01/02 20:16:02 You are quite correct. I had originally thought t
+ selected_item->Resume();
} else if (action == "cancel") {
selected_item->AddObserver(new AutomationProviderDownloadUpdatedObserver(
this, reply_message, false, browser->profile()->IsOffTheRecord()));

Powered by Google App Engine
This is Rietveld 408576698