| 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 2368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2379 view->SetInteger( | 2379 view->SetInteger( |
| 2380 "render_process_id", | 2380 "render_process_id", |
| 2381 render_view_host->GetProcess()->GetID()); | 2381 render_view_host->GetProcess()->GetID()); |
| 2382 view->SetInteger( | 2382 view->SetInteger( |
| 2383 "render_view_id", | 2383 "render_view_id", |
| 2384 render_view_host->GetRoutingID()); | 2384 render_view_host->GetRoutingID()); |
| 2385 item->Set("view", view); | 2385 item->Set("view", view); |
| 2386 std::string type; | 2386 std::string type; |
| 2387 WebContents* web_contents = | 2387 WebContents* web_contents = |
| 2388 WebContents::FromRenderViewHost(render_view_host); | 2388 WebContents::FromRenderViewHost(render_view_host); |
| 2389 chrome::ViewType view_type = chrome::GetViewType(web_contents); | 2389 extensions::ViewType view_type = chrome::GetViewType(web_contents); |
| 2390 switch (view_type) { | 2390 switch (view_type) { |
| 2391 case chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE: | 2391 case extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE: |
| 2392 type = "EXTENSION_BACKGROUND_PAGE"; | 2392 type = "EXTENSION_BACKGROUND_PAGE"; |
| 2393 break; | 2393 break; |
| 2394 case chrome::VIEW_TYPE_EXTENSION_POPUP: | 2394 case extensions::VIEW_TYPE_EXTENSION_POPUP: |
| 2395 type = "EXTENSION_POPUP"; | 2395 type = "EXTENSION_POPUP"; |
| 2396 break; | 2396 break; |
| 2397 case chrome::VIEW_TYPE_EXTENSION_INFOBAR: | 2397 case extensions::VIEW_TYPE_EXTENSION_INFOBAR: |
| 2398 type = "EXTENSION_INFOBAR"; | 2398 type = "EXTENSION_INFOBAR"; |
| 2399 break; | 2399 break; |
| 2400 case chrome::VIEW_TYPE_EXTENSION_DIALOG: | 2400 case extensions::VIEW_TYPE_EXTENSION_DIALOG: |
| 2401 type = "EXTENSION_DIALOG"; | 2401 type = "EXTENSION_DIALOG"; |
| 2402 break; | 2402 break; |
| 2403 case chrome::VIEW_TYPE_APP_SHELL: | 2403 case extensions::VIEW_TYPE_APP_SHELL: |
| 2404 type = "APP_SHELL"; | 2404 type = "APP_SHELL"; |
| 2405 break; | 2405 break; |
| 2406 case chrome::VIEW_TYPE_PANEL: | 2406 case extensions::VIEW_TYPE_PANEL: |
| 2407 type = "PANEL"; | 2407 type = "PANEL"; |
| 2408 break; | 2408 break; |
| 2409 default: | 2409 default: |
| 2410 type = "unknown"; | 2410 type = "unknown"; |
| 2411 break; | 2411 break; |
| 2412 } | 2412 } |
| 2413 item->SetString("view_type", type); | 2413 item->SetString("view_type", type); |
| 2414 item->SetString("url", web_contents->GetURL().spec()); | 2414 item->SetString("url", web_contents->GetURL().spec()); |
| 2415 item->SetBoolean("loaded", !render_view_host->IsLoading()); | 2415 item->SetBoolean("loaded", !render_view_host->IsLoading()); |
| 2416 extension_views->Append(item); | 2416 extension_views->Append(item); |
| (...skipping 3502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5919 if (g_browser_process) | 5919 if (g_browser_process) |
| 5920 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 5920 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
| 5921 } | 5921 } |
| 5922 | 5922 |
| 5923 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, | 5923 void TestingAutomationProvider::EnsureTabSelected(Browser* browser, |
| 5924 WebContents* tab) { | 5924 WebContents* tab) { |
| 5925 TabStripModel* tab_strip = browser->tab_strip_model(); | 5925 TabStripModel* tab_strip = browser->tab_strip_model(); |
| 5926 if (tab_strip->GetActiveWebContents() != tab) | 5926 if (tab_strip->GetActiveWebContents() != tab) |
| 5927 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); | 5927 tab_strip->ActivateTabAt(tab_strip->GetIndexOfWebContents(tab), true); |
| 5928 } | 5928 } |
| OLD | NEW |