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 2186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2197 // Gets info about BrowserChildProcessHost. Must run on IO thread to | 2197 // Gets info about BrowserChildProcessHost. Must run on IO thread to |
2198 // honor the semantics of BrowserChildProcessHostIterator. | 2198 // honor the semantics of BrowserChildProcessHostIterator. |
2199 // Used by AutomationProvider::GetBrowserInfo(). | 2199 // Used by AutomationProvider::GetBrowserInfo(). |
2200 void GetChildProcessHostInfo(ListValue* child_processes) { | 2200 void GetChildProcessHostInfo(ListValue* child_processes) { |
2201 for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) { | 2201 for (BrowserChildProcessHostIterator iter; !iter.Done(); ++iter) { |
2202 // Only add processes which are already started, since we need their handle. | 2202 // Only add processes which are already started, since we need their handle. |
2203 if (iter.GetData().handle == base::kNullProcessHandle) | 2203 if (iter.GetData().handle == base::kNullProcessHandle) |
2204 continue; | 2204 continue; |
2205 DictionaryValue* item = new DictionaryValue; | 2205 DictionaryValue* item = new DictionaryValue; |
2206 item->SetString("name", iter.GetData().name); | 2206 item->SetString("name", iter.GetData().name); |
2207 item->SetString("type", | 2207 item->SetString( |
2208 content::GetProcessTypeNameInEnglish(iter.GetData().type)); | 2208 "type", |
| 2209 content::GetProcessTypeNameInEnglish(iter.GetData().process_type)); |
2209 item->SetInteger("pid", base::GetProcId(iter.GetData().handle)); | 2210 item->SetInteger("pid", base::GetProcId(iter.GetData().handle)); |
2210 child_processes->Append(item); | 2211 child_processes->Append(item); |
2211 } | 2212 } |
2212 } | 2213 } |
2213 | 2214 |
2214 } // namespace | 2215 } // namespace |
2215 | 2216 |
2216 // Sample json input: { "command": "GetBrowserInfo" } | 2217 // Sample json input: { "command": "GetBrowserInfo" } |
2217 // Refer to GetBrowserInfo() in chrome/test/pyautolib/pyauto.py for | 2218 // Refer to GetBrowserInfo() in chrome/test/pyautolib/pyauto.py for |
2218 // sample json output. | 2219 // sample json output. |
(...skipping 3699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5918 if (g_browser_process) | 5919 if (g_browser_process) |
5919 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 5920 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
5920 } | 5921 } |
5921 | 5922 |
5922 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 5923 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
5923 WebContents* tab) { | 5924 WebContents* tab) { |
5924 TabStripModel* tab_strip = browser->tab_strip_model(); | 5925 TabStripModel* tab_strip = browser->tab_strip_model(); |
5925 if (tab_strip->GetActiveWebContents() != tab) | 5926 if (tab_strip->GetActiveWebContents() != tab) |
5926 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); | 5927 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); |
5927 } | 5928 } |
OLD | NEW |