| OLD | NEW |
| 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 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1080 web_contents->GetRenderViewHost()); | 1080 web_contents->GetRenderViewHost()); |
| 1081 } | 1081 } |
| 1082 | 1082 |
| 1083 // Sample json input: { "command": "OpenNewBrowserWindowWithNewProfile" } | 1083 // Sample json input: { "command": "OpenNewBrowserWindowWithNewProfile" } |
| 1084 // Sample output: {} | 1084 // Sample output: {} |
| 1085 void TestingAutomationProvider::OpenNewBrowserWindowWithNewProfile( | 1085 void TestingAutomationProvider::OpenNewBrowserWindowWithNewProfile( |
| 1086 base::DictionaryValue* args, IPC::Message* reply_message) { | 1086 base::DictionaryValue* args, IPC::Message* reply_message) { |
| 1087 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 1087 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| 1088 new BrowserOpenedWithNewProfileNotificationObserver(this, reply_message); | 1088 new BrowserOpenedWithNewProfileNotificationObserver(this, reply_message); |
| 1089 profile_manager->CreateMultiProfileAsync( | 1089 profile_manager->CreateMultiProfileAsync( |
| 1090 string16(), string16(), ProfileManager::CreateCallback(), | 1090 string16(), string16(), ProfileManager::CreateCallback(), false); |
| 1091 chrome::HOST_DESKTOP_TYPE_NATIVE, false); | |
| 1092 } | 1091 } |
| 1093 | 1092 |
| 1094 // Sample json input: { "command": "GetMultiProfileInfo" } | 1093 // Sample json input: { "command": "GetMultiProfileInfo" } |
| 1095 // See GetMultiProfileInfo() in pyauto.py for sample output. | 1094 // See GetMultiProfileInfo() in pyauto.py for sample output. |
| 1096 void TestingAutomationProvider::GetMultiProfileInfo( | 1095 void TestingAutomationProvider::GetMultiProfileInfo( |
| 1097 base::DictionaryValue* args, IPC::Message* reply_message) { | 1096 base::DictionaryValue* args, IPC::Message* reply_message) { |
| 1098 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); | 1097 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); |
| 1099 ProfileManager* profile_manager = g_browser_process->profile_manager(); | 1098 ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| 1100 const ProfileInfoCache& profile_info_cache = | 1099 const ProfileInfoCache& profile_info_cache = |
| 1101 profile_manager->GetProfileInfoCache(); | 1100 profile_manager->GetProfileInfoCache(); |
| (...skipping 4842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5944 if (g_browser_process) | 5943 if (g_browser_process) |
| 5945 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 5944 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
| 5946 } | 5945 } |
| 5947 | 5946 |
| 5948 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 5947 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
| 5949 WebContents* tab) { | 5948 WebContents* tab) { |
| 5950 TabStripModel* tab_strip = browser->tab_strip_model(); | 5949 TabStripModel* tab_strip = browser->tab_strip_model(); |
| 5951 if (tab_strip->GetActiveWebContents() != tab) | 5950 if (tab_strip->GetActiveWebContents() != tab) |
| 5952 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); | 5951 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); |
| 5953 } | 5952 } |
| OLD | NEW |