| 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 2291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2302 browser_item->SetString("profile_path", | 2302 browser_item->SetString("profile_path", |
| 2303 browser->profile()->GetPath().BaseName().MaybeAsASCII()); | 2303 browser->profile()->GetPath().BaseName().MaybeAsASCII()); |
| 2304 std::string type; | 2304 std::string type; |
| 2305 switch (browser->type()) { | 2305 switch (browser->type()) { |
| 2306 case Browser::TYPE_TABBED: | 2306 case Browser::TYPE_TABBED: |
| 2307 type = "tabbed"; | 2307 type = "tabbed"; |
| 2308 break; | 2308 break; |
| 2309 case Browser::TYPE_POPUP: | 2309 case Browser::TYPE_POPUP: |
| 2310 type = "popup"; | 2310 type = "popup"; |
| 2311 break; | 2311 break; |
| 2312 case Browser::TYPE_PANEL: | |
| 2313 type = "panel"; | |
| 2314 break; | |
| 2315 default: | 2312 default: |
| 2316 type = "unknown"; | 2313 type = "unknown"; |
| 2317 break; | 2314 break; |
| 2318 } | 2315 } |
| 2319 browser_item->SetString("type", type); | 2316 browser_item->SetString("type", type); |
| 2320 // For each window, add info about all tabs in a list of dictionaries, | 2317 // For each window, add info about all tabs in a list of dictionaries, |
| 2321 // one dictionary item per tab. | 2318 // one dictionary item per tab. |
| 2322 ListValue* tabs = new ListValue; | 2319 ListValue* tabs = new ListValue; |
| 2323 for (int i = 0; i < browser->tab_strip_model()->count(); ++i) { | 2320 for (int i = 0; i < browser->tab_strip_model()->count(); ++i) { |
| 2324 WebContents* wc = browser->tab_strip_model()->GetWebContentsAt(i); | 2321 WebContents* wc = browser->tab_strip_model()->GetWebContentsAt(i); |
| (...skipping 3594 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5919 if (g_browser_process) | 5916 if (g_browser_process) |
| 5920 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 5917 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
| 5921 } | 5918 } |
| 5922 | 5919 |
| 5923 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 5920 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
| 5924 WebContents* tab) { | 5921 WebContents* tab) { |
| 5925 TabStripModel* tab_strip = browser->tab_strip_model(); | 5922 TabStripModel* tab_strip = browser->tab_strip_model(); |
| 5926 if (tab_strip->GetActiveWebContents() != tab) | 5923 if (tab_strip->GetActiveWebContents() != tab) |
| 5927 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); | 5924 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); |
| 5928 } | 5925 } |
| OLD | NEW |