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

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

Issue 8817005: Revert 113007 - DownloadManager intereface refactoring to allow cleaner DownloadItem unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/download/chrome_download_manager_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Deleted: svn:mergeinfo
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 3156 matching lines...) Expand 10 before | Expand all | Expand 10 after
3167 return; 3167 return;
3168 } 3168 }
3169 3169
3170 if (action == "open") { 3170 if (action == "open") {
3171 selected_item->AddObserver( 3171 selected_item->AddObserver(
3172 new AutomationProviderDownloadUpdatedObserver( 3172 new AutomationProviderDownloadUpdatedObserver(
3173 this, reply_message, true)); 3173 this, reply_message, true));
3174 selected_item->OpenDownload(); 3174 selected_item->OpenDownload();
3175 } else if (action == "toggle_open_files_like_this") { 3175 } else if (action == "toggle_open_files_like_this") {
3176 DownloadPrefs* prefs = 3176 DownloadPrefs* prefs =
3177 DownloadPrefs::FromBrowserContext(selected_item->BrowserContext()); 3177 DownloadPrefs::FromDownloadManager(selected_item->GetDownloadManager());
3178 FilePath path = selected_item->GetUserVerifiedFilePath(); 3178 FilePath path = selected_item->GetUserVerifiedFilePath();
3179 if (!selected_item->ShouldOpenFileBasedOnExtension()) 3179 if (!selected_item->ShouldOpenFileBasedOnExtension())
3180 prefs->EnableAutoOpenBasedOnExtension(path); 3180 prefs->EnableAutoOpenBasedOnExtension(path);
3181 else 3181 else
3182 prefs->DisableAutoOpenBasedOnExtension(path); 3182 prefs->DisableAutoOpenBasedOnExtension(path);
3183 AutomationJSONReply(this, reply_message).SendSuccess(NULL); 3183 AutomationJSONReply(this, reply_message).SendSuccess(NULL);
3184 } else if (action == "remove") { 3184 } else if (action == "remove") {
3185 download_manager->AddObserver( 3185 download_manager->AddObserver(
3186 new AutomationProviderDownloadModelChangedObserver( 3186 new AutomationProviderDownloadModelChangedObserver(
3187 this, reply_message, download_manager)); 3187 this, reply_message, download_manager));
(...skipping 3405 matching lines...) Expand 10 before | Expand all | Expand 10 after
6593 6593
6594 Send(reply_message_); 6594 Send(reply_message_);
6595 redirect_query_ = 0; 6595 redirect_query_ = 0;
6596 reply_message_ = NULL; 6596 reply_message_ = NULL;
6597 } 6597 }
6598 6598
6599 void TestingAutomationProvider::OnRemoveProvider() { 6599 void TestingAutomationProvider::OnRemoveProvider() {
6600 if (g_browser_process) 6600 if (g_browser_process)
6601 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); 6601 g_browser_process->GetAutomationProviderList()->RemoveProvider(this);
6602 } 6602 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/chrome_download_manager_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698