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 1148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 Browser* browser = new Browser( | 1159 Browser* browser = new Browser( |
1160 Browser::CreateParams(static_cast<Browser::Type>(type), profile_)); | 1160 Browser::CreateParams(static_cast<Browser::Type>(type), profile_)); |
1161 chrome::AddBlankTab(browser, true); | 1161 chrome::AddBlankTab(browser, true); |
1162 if (show) | 1162 if (show) |
1163 browser->window()->Show(); | 1163 browser->window()->Show(); |
1164 } | 1164 } |
1165 | 1165 |
1166 void TestingAutomationProvider::OpenNewBrowserWindow( | 1166 void TestingAutomationProvider::OpenNewBrowserWindow( |
1167 base::DictionaryValue* args, | 1167 base::DictionaryValue* args, |
1168 IPC::Message* reply_message) { | 1168 IPC::Message* reply_message) { |
1169 AutomationJSONReply reply(this, reply_message); | |
1170 bool show; | 1169 bool show; |
1171 if (!args->GetBoolean("show", &show)) { | 1170 if (!args->GetBoolean("show", &show)) { |
1172 reply.SendError("'show' missing or invalid."); | 1171 AutomationJSONReply(this, reply_message) |
| 1172 .SendError("'show' missing or invalid."); |
1173 return; | 1173 return; |
1174 } | 1174 } |
1175 new BrowserOpenedNotificationObserver(this, reply_message, true); | 1175 new BrowserOpenedNotificationObserver(this, reply_message, true); |
1176 Browser* browser = new Browser( | 1176 Browser* browser = new Browser( |
1177 Browser::CreateParams(Browser::TYPE_TABBED, profile_)); | 1177 Browser::CreateParams(Browser::TYPE_TABBED, profile_)); |
1178 chrome::AddBlankTab(browser, true); | 1178 chrome::AddBlankTab(browser, true); |
1179 if (show) | 1179 if (show) |
1180 browser->window()->Show(); | 1180 browser->window()->Show(); |
1181 } | 1181 } |
1182 | 1182 |
(...skipping 5994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7177 void TestingAutomationProvider::OnRemoveProvider() { | 7177 void TestingAutomationProvider::OnRemoveProvider() { |
7178 if (g_browser_process) | 7178 if (g_browser_process) |
7179 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 7179 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
7180 } | 7180 } |
7181 | 7181 |
7182 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 7182 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
7183 WebContents* tab) { | 7183 WebContents* tab) { |
7184 if (chrome::GetActiveWebContents(browser) != tab) | 7184 if (chrome::GetActiveWebContents(browser) != tab) |
7185 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true); | 7185 chrome::ActivateTabAt(browser, chrome::GetIndexOfTab(browser, tab), true); |
7186 } | 7186 } |
OLD | NEW |