OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/common/chrome_paths.h" | 104 #include "chrome/common/chrome_paths.h" |
105 #include "chrome/common/chrome_switches.h" | 105 #include "chrome/common/chrome_switches.h" |
106 #include "chrome/common/chrome_view_types.h" | 106 #include "chrome/common/chrome_view_types.h" |
107 #include "chrome/common/extensions/extension.h" | 107 #include "chrome/common/extensions/extension.h" |
108 #include "chrome/common/extensions/url_pattern.h" | 108 #include "chrome/common/extensions/url_pattern.h" |
109 #include "chrome/common/extensions/url_pattern_set.h" | 109 #include "chrome/common/extensions/url_pattern_set.h" |
110 #include "chrome/common/pref_names.h" | 110 #include "chrome/common/pref_names.h" |
111 #include "chrome/common/render_messages.h" | 111 #include "chrome/common/render_messages.h" |
112 #include "chrome/common/url_constants.h" | 112 #include "chrome/common/url_constants.h" |
113 #include "content/browser/plugin_service.h" | 113 #include "content/browser/plugin_service.h" |
114 #include "content/browser/renderer_host/render_process_host.h" | |
115 #include "content/browser/renderer_host/render_view_host.h" | 114 #include "content/browser/renderer_host/render_view_host.h" |
116 #include "content/browser/tab_contents/interstitial_page.h" | 115 #include "content/browser/tab_contents/interstitial_page.h" |
117 #include "content/public/browser/notification_service.h" | 116 #include "content/public/browser/notification_service.h" |
| 117 #include "content/public/browser/render_process_host.h" |
118 #include "content/public/common/common_param_traits.h" | 118 #include "content/public/common/common_param_traits.h" |
119 #include "net/base/cookie_store.h" | 119 #include "net/base/cookie_store.h" |
120 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 120 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
121 #include "ui/base/events.h" | 121 #include "ui/base/events.h" |
122 #include "ui/base/keycodes/keyboard_codes.h" | 122 #include "ui/base/keycodes/keyboard_codes.h" |
123 #include "ui/base/ui_base_types.h" | 123 #include "ui/base/ui_base_types.h" |
124 #include "webkit/glue/webdropdata.h" | 124 #include "webkit/glue/webdropdata.h" |
125 #include "webkit/plugins/webplugininfo.h" | 125 #include "webkit/plugins/webplugininfo.h" |
126 | 126 |
127 #if defined(ENABLE_CONFIGURATION_POLICY) | 127 #if defined(ENABLE_CONFIGURATION_POLICY) |
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 } | 1251 } |
1252 } | 1252 } |
1253 | 1253 |
1254 void TestingAutomationProvider::GetTabProcessID(int handle, int* process_id) { | 1254 void TestingAutomationProvider::GetTabProcessID(int handle, int* process_id) { |
1255 *process_id = -1; | 1255 *process_id = -1; |
1256 | 1256 |
1257 if (tab_tracker_->ContainsHandle(handle)) { | 1257 if (tab_tracker_->ContainsHandle(handle)) { |
1258 *process_id = 0; | 1258 *process_id = 0; |
1259 TabContents* tab_contents = | 1259 TabContents* tab_contents = |
1260 tab_tracker_->GetResource(handle)->tab_contents(); | 1260 tab_tracker_->GetResource(handle)->tab_contents(); |
1261 RenderProcessHost* rph = tab_contents->GetRenderProcessHost(); | 1261 content::RenderProcessHost* rph = tab_contents->GetRenderProcessHost(); |
1262 if (rph) | 1262 if (rph) |
1263 *process_id = base::GetProcId(rph->GetHandle()); | 1263 *process_id = base::GetProcId(rph->GetHandle()); |
1264 } | 1264 } |
1265 } | 1265 } |
1266 | 1266 |
1267 void TestingAutomationProvider::GetTabTitle(int handle, | 1267 void TestingAutomationProvider::GetTabTitle(int handle, |
1268 int* title_string_size, | 1268 int* title_string_size, |
1269 std::wstring* title) { | 1269 std::wstring* title) { |
1270 *title_string_size = -1; // -1 is the error code | 1270 *title_string_size = -1; // -1 is the error code |
1271 if (tab_tracker_->ContainsHandle(handle)) { | 1271 if (tab_tracker_->ContainsHandle(handle)) { |
(...skipping 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2874 continue; | 2874 continue; |
2875 DictionaryValue* item = new DictionaryValue; | 2875 DictionaryValue* item = new DictionaryValue; |
2876 item->SetString("name", ex_host->extension()->name()); | 2876 item->SetString("name", ex_host->extension()->name()); |
2877 item->SetString("extension_id", ex_host->extension()->id()); | 2877 item->SetString("extension_id", ex_host->extension()->id()); |
2878 item->SetInteger( | 2878 item->SetInteger( |
2879 "pid", | 2879 "pid", |
2880 base::GetProcId(ex_host->render_process_host()->GetHandle())); | 2880 base::GetProcId(ex_host->render_process_host()->GetHandle())); |
2881 DictionaryValue* view = new DictionaryValue; | 2881 DictionaryValue* view = new DictionaryValue; |
2882 view->SetInteger( | 2882 view->SetInteger( |
2883 "render_process_id", | 2883 "render_process_id", |
2884 ex_host->render_process_host()->id()); | 2884 ex_host->render_process_host()->GetID()); |
2885 view->SetInteger( | 2885 view->SetInteger( |
2886 "render_view_id", | 2886 "render_view_id", |
2887 ex_host->render_view_host()->routing_id()); | 2887 ex_host->render_view_host()->routing_id()); |
2888 item->Set("view", view); | 2888 item->Set("view", view); |
2889 std::string type; | 2889 std::string type; |
2890 switch (ex_host->extension_host_type()) { | 2890 switch (ex_host->extension_host_type()) { |
2891 case chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE: | 2891 case chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE: |
2892 type = "EXTENSION_BACKGROUND_PAGE"; | 2892 type = "EXTENSION_BACKGROUND_PAGE"; |
2893 break; | 2893 break; |
2894 case chrome::VIEW_TYPE_EXTENSION_POPUP: | 2894 case chrome::VIEW_TYPE_EXTENSION_POPUP: |
(...skipping 3493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6388 | 6388 |
6389 Send(reply_message_); | 6389 Send(reply_message_); |
6390 redirect_query_ = 0; | 6390 redirect_query_ = 0; |
6391 reply_message_ = NULL; | 6391 reply_message_ = NULL; |
6392 } | 6392 } |
6393 | 6393 |
6394 void TestingAutomationProvider::OnRemoveProvider() { | 6394 void TestingAutomationProvider::OnRemoveProvider() { |
6395 if (g_browser_process) | 6395 if (g_browser_process) |
6396 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); | 6396 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); |
6397 } | 6397 } |
OLD | NEW |