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 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1196 AutomationJSONReply(this, reply_message).SendSuccess(return_value.get()); | 1196 AutomationJSONReply(this, reply_message).SendSuccess(return_value.get()); |
1197 } | 1197 } |
1198 | 1198 |
1199 void TestingAutomationProvider::OpenNewBrowserWindowOfType( | 1199 void TestingAutomationProvider::OpenNewBrowserWindowOfType( |
1200 int type, bool show, IPC::Message* reply_message) { | 1200 int type, bool show, IPC::Message* reply_message) { |
1201 new BrowserOpenedNotificationObserver(this, reply_message); | 1201 new BrowserOpenedNotificationObserver(this, reply_message); |
1202 // We may have no current browser windows open so don't rely on | 1202 // We may have no current browser windows open so don't rely on |
1203 // asking an existing browser to execute the IDC_NEWWINDOW command | 1203 // asking an existing browser to execute the IDC_NEWWINDOW command |
1204 Browser* browser = new Browser(static_cast<Browser::Type>(type), profile_); | 1204 Browser* browser = new Browser(static_cast<Browser::Type>(type), profile_); |
1205 browser->InitBrowserWindow(); | 1205 browser->InitBrowserWindow(); |
1206 browser->AddBlankTab(true); | 1206 chrome::AddBlankTab(browser, true); |
1207 if (show) | 1207 if (show) |
1208 browser->window()->Show(); | 1208 browser->window()->Show(); |
1209 } | 1209 } |
1210 | 1210 |
1211 void TestingAutomationProvider::OpenProfileWindow( | 1211 void TestingAutomationProvider::OpenProfileWindow( |
1212 base::DictionaryValue* args, IPC::Message* reply_message) { | 1212 base::DictionaryValue* args, IPC::Message* reply_message) { |
1213 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 1213 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
1214 FilePath::StringType path; | 1214 FilePath::StringType path; |
1215 if (!args->GetString("path", &path)) { | 1215 if (!args->GetString("path", &path)) { |
1216 AutomationJSONReply(this, reply_message).SendError( | 1216 AutomationJSONReply(this, reply_message).SendError( |
(...skipping 5553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6770 void TestingAutomationProvider::OnRemoveProvider() { | 6770 void TestingAutomationProvider::OnRemoveProvider() { |
6771 if (g_browser_process) | 6771 if (g_browser_process) |
6772 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6772 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
6773 } | 6773 } |
6774 | 6774 |
6775 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 6775 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
6776 WebContents* tab) { | 6776 WebContents* tab) { |
6777 if (chrome::GetActiveWebContents(browser) != tab) | 6777 if (chrome::GetActiveWebContents(browser) != tab) |
6778 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true); | 6778 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true); |
6779 } | 6779 } |
OLD | NEW |