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

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: Final Cancel arg fix. 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
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 3093 matching lines...) Expand 10 before | Expand all | Expand 10 after
3104 this, reply_message, false)); 3104 this, reply_message, false));
3105 selected_item->DangerousDownloadValidated(); 3105 selected_item->DangerousDownloadValidated();
3106 } else if (action == "toggle_pause") { 3106 } else if (action == "toggle_pause") {
3107 selected_item->AddObserver(new AutomationProviderDownloadUpdatedObserver( 3107 selected_item->AddObserver(new AutomationProviderDownloadUpdatedObserver(
3108 this, reply_message, false)); 3108 this, reply_message, false));
3109 // This will still return if download has already completed. 3109 // This will still return if download has already completed.
3110 selected_item->TogglePause(); 3110 selected_item->TogglePause();
3111 } else if (action == "cancel") { 3111 } else if (action == "cancel") {
3112 selected_item->AddObserver(new AutomationProviderDownloadUpdatedObserver( 3112 selected_item->AddObserver(new AutomationProviderDownloadUpdatedObserver(
3113 this, reply_message, false)); 3113 this, reply_message, false));
3114 selected_item->Cancel(true); 3114 selected_item->Cancel();
3115 } else { 3115 } else {
3116 AutomationJSONReply(this, reply_message) 3116 AutomationJSONReply(this, reply_message)
3117 .SendError(StringPrintf("Invalid action '%s' given.", action.c_str())); 3117 .SendError(StringPrintf("Invalid action '%s' given.", action.c_str()));
3118 } 3118 }
3119 } 3119 }
3120 3120
3121 // Sample JSON input { "command": "LoadSearchEngineInfo" } 3121 // Sample JSON input { "command": "LoadSearchEngineInfo" }
3122 void TestingAutomationProvider::LoadSearchEngineInfo( 3122 void TestingAutomationProvider::LoadSearchEngineInfo(
3123 Browser* browser, 3123 Browser* browser,
3124 DictionaryValue* args, 3124 DictionaryValue* args,
(...skipping 3213 matching lines...) Expand 10 before | Expand all | Expand 10 after
6338 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); 6338 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl);
6339 6339
6340 Send(reply_message_); 6340 Send(reply_message_);
6341 redirect_query_ = 0; 6341 redirect_query_ = 0;
6342 reply_message_ = NULL; 6342 reply_message_ = NULL;
6343 } 6343 }
6344 6344
6345 void TestingAutomationProvider::OnRemoveProvider() { 6345 void TestingAutomationProvider::OnRemoveProvider() {
6346 AutomationProviderList::GetInstance()->RemoveProvider(this); 6346 AutomationProviderList::GetInstance()->RemoveProvider(this);
6347 } 6347 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/chrome_download_manager_delegate.h » ('j') | content/browser/download/download_item.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698