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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 #include "chrome/browser/ui/browser_window.h" | 104 #include "chrome/browser/ui/browser_window.h" |
105 #include "chrome/browser/ui/find_bar/find_bar.h" | 105 #include "chrome/browser/ui/find_bar/find_bar.h" |
106 #include "chrome/browser/ui/fullscreen_controller.h" | 106 #include "chrome/browser/ui/fullscreen_controller.h" |
107 #include "chrome/browser/ui/fullscreen_exit_bubble_type.h" | 107 #include "chrome/browser/ui/fullscreen_exit_bubble_type.h" |
108 #include "chrome/browser/ui/login/login_prompt.h" | 108 #include "chrome/browser/ui/login/login_prompt.h" |
109 #include "chrome/browser/ui/media_stream_infobar_delegate.h" | 109 #include "chrome/browser/ui/media_stream_infobar_delegate.h" |
110 #include "chrome/browser/ui/omnibox/location_bar.h" | 110 #include "chrome/browser/ui/omnibox/location_bar.h" |
111 #include "chrome/browser/ui/omnibox/omnibox_view.h" | 111 #include "chrome/browser/ui/omnibox/omnibox_view.h" |
112 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h" | 112 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h" |
113 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 113 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 114 #include "chrome/browser/view_type_utils.h" |
114 #include "chrome/common/automation_id.h" | 115 #include "chrome/common/automation_id.h" |
115 #include "chrome/common/automation_messages.h" | 116 #include "chrome/common/automation_messages.h" |
116 #include "chrome/common/chrome_constants.h" | 117 #include "chrome/common/chrome_constants.h" |
117 #include "chrome/common/chrome_notification_types.h" | 118 #include "chrome/common/chrome_notification_types.h" |
118 #include "chrome/common/chrome_paths.h" | 119 #include "chrome/common/chrome_paths.h" |
119 #include "chrome/common/chrome_switches.h" | 120 #include "chrome/common/chrome_switches.h" |
120 #include "chrome/common/chrome_view_type.h" | |
121 #include "chrome/common/extensions/extension.h" | 121 #include "chrome/common/extensions/extension.h" |
122 #include "chrome/common/extensions/extension_action.h" | 122 #include "chrome/common/extensions/extension_action.h" |
123 #include "chrome/common/extensions/url_pattern.h" | 123 #include "chrome/common/extensions/url_pattern.h" |
124 #include "chrome/common/extensions/url_pattern_set.h" | 124 #include "chrome/common/extensions/url_pattern_set.h" |
125 #include "chrome/common/pref_names.h" | 125 #include "chrome/common/pref_names.h" |
126 #include "chrome/common/render_messages.h" | 126 #include "chrome/common/render_messages.h" |
127 #include "chrome/common/url_constants.h" | 127 #include "chrome/common/url_constants.h" |
128 #include "content/public/browser/browser_child_process_host_iterator.h" | 128 #include "content/public/browser/browser_child_process_host_iterator.h" |
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 |