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

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

Issue 15011006: Remove DownloadItem::GetUserVerifiedFilePath() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with r201294 Created 7 years, 7 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/download_shelf_context_menu.cc » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 2625 matching lines...) Expand 10 before | Expand all | Expand 10 after
2636 } 2636 }
2637 2637
2638 if (action == "open") { 2638 if (action == "open") {
2639 selected_item->AddObserver( 2639 selected_item->AddObserver(
2640 new AutomationProviderDownloadUpdatedObserver( 2640 new AutomationProviderDownloadUpdatedObserver(
2641 this, reply_message, true, browser->profile()->IsOffTheRecord())); 2641 this, reply_message, true, browser->profile()->IsOffTheRecord()));
2642 selected_item->OpenDownload(); 2642 selected_item->OpenDownload();
2643 } else if (action == "toggle_open_files_like_this") { 2643 } else if (action == "toggle_open_files_like_this") {
2644 DownloadPrefs* prefs = 2644 DownloadPrefs* prefs =
2645 DownloadPrefs::FromBrowserContext(selected_item->GetBrowserContext()); 2645 DownloadPrefs::FromBrowserContext(selected_item->GetBrowserContext());
2646 base::FilePath path = selected_item->GetUserVerifiedFilePath(); 2646 base::FilePath path = selected_item->GetTargetFilePath();
2647 if (!selected_item->ShouldOpenFileBasedOnExtension()) 2647 if (!selected_item->ShouldOpenFileBasedOnExtension())
2648 prefs->EnableAutoOpenBasedOnExtension(path); 2648 prefs->EnableAutoOpenBasedOnExtension(path);
2649 else 2649 else
2650 prefs->DisableAutoOpenBasedOnExtension(path); 2650 prefs->DisableAutoOpenBasedOnExtension(path);
2651 AutomationJSONReply(this, reply_message).SendSuccess(NULL); 2651 AutomationJSONReply(this, reply_message).SendSuccess(NULL);
2652 } else if (action == "remove") { 2652 } else if (action == "remove") {
2653 new AutomationProviderDownloadModelChangedObserver( 2653 new AutomationProviderDownloadModelChangedObserver(
2654 this, reply_message, download_manager); 2654 this, reply_message, download_manager);
2655 selected_item->Remove(); 2655 selected_item->Remove();
2656 } else if (action == "decline_dangerous_download") { 2656 } else if (action == "decline_dangerous_download") {
(...skipping 3287 matching lines...) Expand 10 before | Expand all | Expand 10 after
5944 if (g_browser_process) 5944 if (g_browser_process)
5945 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); 5945 g_browser_process->GetAutomationProviderList()->RemoveProvider(this);
5946 } 5946 }
5947 5947
5948 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, 5948 void TestingAutomationProvider::EnsureTabSelected(Browser* browser,
5949 WebContents* tab) { 5949 WebContents* tab) {
5950 TabStripModel* tab_strip = browser->tab_strip_model(); 5950 TabStripModel* tab_strip = browser->tab_strip_model();
5951 if (tab_strip->GetActiveWebContents() != tab) 5951 if (tab_strip->GetActiveWebContents() != tab)
5952 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); 5952 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true);
5953 } 5953 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/download/download_shelf_context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698