OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 web_contents->GetRenderViewHost()); | 1145 web_contents->GetRenderViewHost()); |
1146 } | 1146 } |
1147 | 1147 |
1148 void TestingAutomationProvider::GetDownloadDirectory( | 1148 void TestingAutomationProvider::GetDownloadDirectory( |
1149 int handle, FilePath* download_directory) { | 1149 int handle, FilePath* download_directory) { |
1150 if (tab_tracker_->ContainsHandle(handle)) { | 1150 if (tab_tracker_->ContainsHandle(handle)) { |
1151 NavigationController* tab = tab_tracker_->GetResource(handle); | 1151 NavigationController* tab = tab_tracker_->GetResource(handle); |
1152 DownloadManager* dlm = | 1152 DownloadManager* dlm = |
1153 BrowserContext::GetDownloadManager(tab->GetBrowserContext()); | 1153 BrowserContext::GetDownloadManager(tab->GetBrowserContext()); |
1154 *download_directory = | 1154 *download_directory = |
1155 DownloadPrefs::FromDownloadManager(dlm)->download_path(); | 1155 DownloadPrefs::FromDownloadManager(dlm)->DownloadPath(); |
1156 } | 1156 } |
1157 } | 1157 } |
1158 | 1158 |
1159 // Sample json input: { "command": "OpenNewBrowserWindowWithNewProfile" } | 1159 // Sample json input: { "command": "OpenNewBrowserWindowWithNewProfile" } |
1160 // Sample output: {} | 1160 // Sample output: {} |
1161 void TestingAutomationProvider::OpenNewBrowserWindowWithNewProfile( | 1161 void TestingAutomationProvider::OpenNewBrowserWindowWithNewProfile( |
1162 base::DictionaryValue* args, IPC::Message* reply_message) { | 1162 base::DictionaryValue* args, IPC::Message* reply_message) { |
1163 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 1163 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
1164 new BrowserOpenedWithNewProfileNotificationObserver(this, reply_message); | 1164 new BrowserOpenedWithNewProfileNotificationObserver(this, reply_message); |
1165 profile_manager->CreateMultiProfileAsync(string16(), string16()); | 1165 profile_manager->CreateMultiProfileAsync(string16(), string16()); |
(...skipping 5738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6904 void TestingAutomationProvider::OnRemoveProvider() { | 6904 void TestingAutomationProvider::OnRemoveProvider() { |
6905 if (g_browser_process) | 6905 if (g_browser_process) |
6906 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6906 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
6907 } | 6907 } |
6908 | 6908 |
6909 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 6909 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
6910 WebContents* tab) { | 6910 WebContents* tab) { |
6911 if (chrome::GetActiveWebContents(browser) != tab) | 6911 if (chrome::GetActiveWebContents(browser) != tab) |
6912 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true); | 6912 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true); |
6913 } | 6913 } |
OLD | NEW |