| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 #include "content/public/browser/child_process_data.h" | 129 #include "content/public/browser/child_process_data.h" |
| 130 #include "content/public/browser/favicon_status.h" | 130 #include "content/public/browser/favicon_status.h" |
| 131 #include "content/public/browser/geolocation.h" | 131 #include "content/public/browser/geolocation.h" |
| 132 #include "content/public/browser/interstitial_page.h" | 132 #include "content/public/browser/interstitial_page.h" |
| 133 #include "content/public/browser/interstitial_page_delegate.h" | 133 #include "content/public/browser/interstitial_page_delegate.h" |
| 134 #include "content/public/browser/navigation_entry.h" | 134 #include "content/public/browser/navigation_entry.h" |
| 135 #include "content/public/browser/notification_service.h" | 135 #include "content/public/browser/notification_service.h" |
| 136 #include "content/public/browser/plugin_service.h" | 136 #include "content/public/browser/plugin_service.h" |
| 137 #include "content/public/browser/render_process_host.h" | 137 #include "content/public/browser/render_process_host.h" |
| 138 #include "content/public/browser/render_view_host.h" | 138 #include "content/public/browser/render_view_host.h" |
| 139 #include "content/public/browser/render_view_host_delegate.h" | |
| 140 #include "content/public/browser/render_widget_host_view.h" | 139 #include "content/public/browser/render_widget_host_view.h" |
| 141 #include "content/public/browser/web_contents.h" | 140 #include "content/public/browser/web_contents.h" |
| 142 #include "content/public/common/child_process_host.h" | 141 #include "content/public/common/child_process_host.h" |
| 143 #include "content/public/common/common_param_traits.h" | 142 #include "content/public/common/common_param_traits.h" |
| 144 #include "content/public/common/geoposition.h" | 143 #include "content/public/common/geoposition.h" |
| 145 #include "content/public/common/ssl_status.h" | 144 #include "content/public/common/ssl_status.h" |
| 146 #include "net/cookies/cookie_store.h" | 145 #include "net/cookies/cookie_store.h" |
| 147 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 146 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 148 #include "ui/base/events.h" | 147 #include "ui/base/events.h" |
| 149 #include "ui/base/keycodes/keyboard_codes.h" | 148 #include "ui/base/keycodes/keyboard_codes.h" |
| (...skipping 2254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2404 base::GetProcId(render_view_host->GetProcess()->GetHandle())); | 2403 base::GetProcId(render_view_host->GetProcess()->GetHandle())); |
| 2405 DictionaryValue* view = new DictionaryValue; | 2404 DictionaryValue* view = new DictionaryValue; |
| 2406 view->SetInteger( | 2405 view->SetInteger( |
| 2407 "render_process_id", | 2406 "render_process_id", |
| 2408 render_view_host->GetProcess()->GetID()); | 2407 render_view_host->GetProcess()->GetID()); |
| 2409 view->SetInteger( | 2408 view->SetInteger( |
| 2410 "render_view_id", | 2409 "render_view_id", |
| 2411 render_view_host->GetRoutingID()); | 2410 render_view_host->GetRoutingID()); |
| 2412 item->Set("view", view); | 2411 item->Set("view", view); |
| 2413 std::string type; | 2412 std::string type; |
| 2414 switch (render_view_host->GetDelegate()->GetRenderViewType()) { | 2413 WebContents* web_contents = |
| 2414 WebContents::FromRenderViewHost(render_view_host); |
| 2415 chrome::ViewType view_type = chrome::GetViewType(web_contents); |
| 2416 switch (view_type) { |
| 2415 case chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE: | 2417 case chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE: |
| 2416 type = "EXTENSION_BACKGROUND_PAGE"; | 2418 type = "EXTENSION_BACKGROUND_PAGE"; |
| 2417 break; | 2419 break; |
| 2418 case chrome::VIEW_TYPE_EXTENSION_POPUP: | 2420 case chrome::VIEW_TYPE_EXTENSION_POPUP: |
| 2419 type = "EXTENSION_POPUP"; | 2421 type = "EXTENSION_POPUP"; |
| 2420 break; | 2422 break; |
| 2421 case chrome::VIEW_TYPE_EXTENSION_INFOBAR: | 2423 case chrome::VIEW_TYPE_EXTENSION_INFOBAR: |
| 2422 type = "EXTENSION_INFOBAR"; | 2424 type = "EXTENSION_INFOBAR"; |
| 2423 break; | 2425 break; |
| 2424 case chrome::VIEW_TYPE_EXTENSION_DIALOG: | 2426 case chrome::VIEW_TYPE_EXTENSION_DIALOG: |
| 2425 type = "EXTENSION_DIALOG"; | 2427 type = "EXTENSION_DIALOG"; |
| 2426 break; | 2428 break; |
| 2427 case chrome::VIEW_TYPE_APP_SHELL: | 2429 case chrome::VIEW_TYPE_APP_SHELL: |
| 2428 type = "APP_SHELL"; | 2430 type = "APP_SHELL"; |
| 2429 break; | 2431 break; |
| 2430 case chrome::VIEW_TYPE_PANEL: | 2432 case chrome::VIEW_TYPE_PANEL: |
| 2431 type = "PANEL"; | 2433 type = "PANEL"; |
| 2432 break; | 2434 break; |
| 2433 default: | 2435 default: |
| 2434 type = "unknown"; | 2436 type = "unknown"; |
| 2435 break; | 2437 break; |
| 2436 } | 2438 } |
| 2437 item->SetString("view_type", type); | 2439 item->SetString("view_type", type); |
| 2438 item->SetString("url", render_view_host->GetDelegate()->GetURL().spec()); | 2440 item->SetString("url", web_contents->GetURL().spec()); |
| 2439 item->SetBoolean("loaded", !render_view_host->IsLoading()); | 2441 item->SetBoolean("loaded", !render_view_host->IsLoading()); |
| 2440 extension_views->Append(item); | 2442 extension_views->Append(item); |
| 2441 } | 2443 } |
| 2442 } | 2444 } |
| 2443 return_value->Set("extension_views", extension_views); | 2445 return_value->Set("extension_views", extension_views); |
| 2444 | 2446 |
| 2445 return_value->SetString("child_process_path", | 2447 return_value->SetString("child_process_path", |
| 2446 ChildProcessHost::GetChildPath(flags).value()); | 2448 ChildProcessHost::GetChildPath(flags).value()); |
| 2447 // Child processes are the processes for plugins and other workers. | 2449 // Child processes are the processes for plugins and other workers. |
| 2448 // Add all child processes in a list of dictionaries, one dictionary item | 2450 // Add all child processes in a list of dictionaries, one dictionary item |
| (...skipping 4121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6570 | 6572 |
| 6571 void TestingAutomationProvider::WaitForProcessLauncherThreadToGoIdle( | 6573 void TestingAutomationProvider::WaitForProcessLauncherThreadToGoIdle( |
| 6572 IPC::Message* reply_message) { | 6574 IPC::Message* reply_message) { |
| 6573 new WaitForProcessLauncherThreadToGoIdleObserver(this, reply_message); | 6575 new WaitForProcessLauncherThreadToGoIdleObserver(this, reply_message); |
| 6574 } | 6576 } |
| 6575 | 6577 |
| 6576 void TestingAutomationProvider::OnRemoveProvider() { | 6578 void TestingAutomationProvider::OnRemoveProvider() { |
| 6577 if (g_browser_process) | 6579 if (g_browser_process) |
| 6578 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6580 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
| 6579 } | 6581 } |
| OLD | NEW |