| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 #include "chrome/common/automation_messages.h" | 90 #include "chrome/common/automation_messages.h" |
| 91 #include "chrome/common/chrome_constants.h" | 91 #include "chrome/common/chrome_constants.h" |
| 92 #include "chrome/common/chrome_paths.h" | 92 #include "chrome/common/chrome_paths.h" |
| 93 #include "chrome/common/chrome_switches.h" | 93 #include "chrome/common/chrome_switches.h" |
| 94 #include "chrome/common/extensions/extension.h" | 94 #include "chrome/common/extensions/extension.h" |
| 95 #include "chrome/common/extensions/url_pattern.h" | 95 #include "chrome/common/extensions/url_pattern.h" |
| 96 #include "chrome/common/extensions/url_pattern_set.h" | 96 #include "chrome/common/extensions/url_pattern_set.h" |
| 97 #include "chrome/common/pref_names.h" | 97 #include "chrome/common/pref_names.h" |
| 98 #include "chrome/common/render_messages.h" | 98 #include "chrome/common/render_messages.h" |
| 99 #include "chrome/common/url_constants.h" | 99 #include "chrome/common/url_constants.h" |
| 100 #include "content/browser/debugger/devtools_manager.h" | 100 #include "content/browser/debugger/devtools_window.h" |
| 101 #include "content/browser/renderer_host/render_process_host.h" | 101 #include "content/browser/renderer_host/render_process_host.h" |
| 102 #include "content/browser/renderer_host/render_view_host.h" | 102 #include "content/browser/renderer_host/render_view_host.h" |
| 103 #include "content/browser/tab_contents/interstitial_page.h" | 103 #include "content/browser/tab_contents/interstitial_page.h" |
| 104 #include "content/common/common_param_traits.h" | 104 #include "content/common/common_param_traits.h" |
| 105 #include "content/common/notification_service.h" | 105 #include "content/common/notification_service.h" |
| 106 #include "net/base/cookie_store.h" | 106 #include "net/base/cookie_store.h" |
| 107 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 107 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 108 #include "ui/base/events.h" | 108 #include "ui/base/events.h" |
| 109 #include "ui/base/keycodes/keyboard_codes.h" | 109 #include "ui/base/keycodes/keyboard_codes.h" |
| 110 #include "ui/base/message_box_flags.h" | 110 #include "ui/base/message_box_flags.h" |
| (...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1299 } | 1299 } |
| 1300 } | 1300 } |
| 1301 | 1301 |
| 1302 void TestingAutomationProvider::HandleInspectElementRequest( | 1302 void TestingAutomationProvider::HandleInspectElementRequest( |
| 1303 int handle, int x, int y, IPC::Message* reply_message) { | 1303 int handle, int x, int y, IPC::Message* reply_message) { |
| 1304 TabContents* tab_contents = GetTabContentsForHandle(handle, NULL); | 1304 TabContents* tab_contents = GetTabContentsForHandle(handle, NULL); |
| 1305 if (tab_contents) { | 1305 if (tab_contents) { |
| 1306 DCHECK(!reply_message_); | 1306 DCHECK(!reply_message_); |
| 1307 reply_message_ = reply_message; | 1307 reply_message_ = reply_message; |
| 1308 | 1308 |
| 1309 DevToolsManager::GetInstance()->InspectElement( | 1309 DevToolsWindow::InspectElement(tab_contents->render_view_host(), x, y); |
| 1310 tab_contents->render_view_host(), x, y); | |
| 1311 } else { | 1310 } else { |
| 1312 AutomationMsg_InspectElement::WriteReplyParams(reply_message, -1); | 1311 AutomationMsg_InspectElement::WriteReplyParams(reply_message, -1); |
| 1313 Send(reply_message); | 1312 Send(reply_message); |
| 1314 } | 1313 } |
| 1315 } | 1314 } |
| 1316 | 1315 |
| 1317 void TestingAutomationProvider::GetDownloadDirectory( | 1316 void TestingAutomationProvider::GetDownloadDirectory( |
| 1318 int handle, FilePath* download_directory) { | 1317 int handle, FilePath* download_directory) { |
| 1319 if (tab_tracker_->ContainsHandle(handle)) { | 1318 if (tab_tracker_->ContainsHandle(handle)) { |
| 1320 NavigationController* tab = tab_tracker_->GetResource(handle); | 1319 NavigationController* tab = tab_tracker_->GetResource(handle); |
| (...skipping 4724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6045 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); | 6044 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); |
| 6046 | 6045 |
| 6047 Send(reply_message_); | 6046 Send(reply_message_); |
| 6048 redirect_query_ = 0; | 6047 redirect_query_ = 0; |
| 6049 reply_message_ = NULL; | 6048 reply_message_ = NULL; |
| 6050 } | 6049 } |
| 6051 | 6050 |
| 6052 void TestingAutomationProvider::OnRemoveProvider() { | 6051 void TestingAutomationProvider::OnRemoveProvider() { |
| 6053 AutomationProviderList::GetInstance()->RemoveProvider(this); | 6052 AutomationProviderList::GetInstance()->RemoveProvider(this); |
| 6054 } | 6053 } |
| OLD | NEW |