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

Side by Side Diff: chrome/browser/automation/testing_automation_provider.cc

Issue 7796014: Make cancel remove cancelled download from active queues at time of cancel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix to try to get past main waterfall failure. Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/download/chrome_download_manager_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/automation/testing_automation_provider.h" 5 #include "chrome/browser/automation/testing_automation_provider.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 3109 matching lines...) Expand 10 before | Expand all | Expand 10 after
3120 this, reply_message, false)); 3120 this, reply_message, false));
3121 selected_item->DangerousDownloadValidated(); 3121 selected_item->DangerousDownloadValidated();
3122 } else if (action == "toggle_pause") { 3122 } else if (action == "toggle_pause") {
3123 selected_item->AddObserver(new AutomationProviderDownloadUpdatedObserver( 3123 selected_item->AddObserver(new AutomationProviderDownloadUpdatedObserver(
3124 this, reply_message, false)); 3124 this, reply_message, false));
3125 // This will still return if download has already completed. 3125 // This will still return if download has already completed.
3126 selected_item->TogglePause(); 3126 selected_item->TogglePause();
3127 } else if (action == "cancel") { 3127 } else if (action == "cancel") {
3128 selected_item->AddObserver(new AutomationProviderDownloadUpdatedObserver( 3128 selected_item->AddObserver(new AutomationProviderDownloadUpdatedObserver(
3129 this, reply_message, false)); 3129 this, reply_message, false));
3130 selected_item->Cancel(true); 3130 selected_item->Cancel();
3131 } else { 3131 } else {
3132 AutomationJSONReply(this, reply_message) 3132 AutomationJSONReply(this, reply_message)
3133 .SendError(StringPrintf("Invalid action '%s' given.", action.c_str())); 3133 .SendError(StringPrintf("Invalid action '%s' given.", action.c_str()));
3134 } 3134 }
3135 } 3135 }
3136 3136
3137 // Sample JSON input { "command": "LoadSearchEngineInfo" } 3137 // Sample JSON input { "command": "LoadSearchEngineInfo" }
3138 void TestingAutomationProvider::LoadSearchEngineInfo( 3138 void TestingAutomationProvider::LoadSearchEngineInfo(
3139 Browser* browser, 3139 Browser* browser,
3140 DictionaryValue* args, 3140 DictionaryValue* args,
(...skipping 3206 matching lines...) Expand 10 before | Expand all | Expand 10 after
6347 6347
6348 Send(reply_message_); 6348 Send(reply_message_);
6349 redirect_query_ = 0; 6349 redirect_query_ = 0;
6350 reply_message_ = NULL; 6350 reply_message_ = NULL;
6351 } 6351 }
6352 6352
6353 void TestingAutomationProvider::OnRemoveProvider() { 6353 void TestingAutomationProvider::OnRemoveProvider() {
6354 if (g_browser_process) 6354 if (g_browser_process)
6355 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); 6355 g_browser_process->GetAutomationProviderList()->RemoveProvider(this);
6356 } 6356 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/chrome_download_manager_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698