| 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/test/automation/automation_json_requests.h" | 5 #include "chrome/test/automation/automation_json_requests.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 : view_id(view_id), | 196 : view_id(view_id), |
| 197 extension_id(extension_id) {} | 197 extension_id(extension_id) {} |
| 198 | 198 |
| 199 WebViewInfo::~WebViewInfo() {} | 199 WebViewInfo::~WebViewInfo() {} |
| 200 | 200 |
| 201 bool SendAutomationJSONRequest(AutomationMessageSender* sender, | 201 bool SendAutomationJSONRequest(AutomationMessageSender* sender, |
| 202 const std::string& request, | 202 const std::string& request, |
| 203 int timeout_ms, | 203 int timeout_ms, |
| 204 std::string* reply, | 204 std::string* reply, |
| 205 bool* success) { | 205 bool* success) { |
| 206 return sender->Send(new AutomationMsg_SendJSONRequest( | 206 return sender->Send(new AutomationMsg_SendJSONRequestWithBrowserHandle( |
| 207 -1, request, reply, success), timeout_ms); | 207 -1, request, reply, success), timeout_ms); |
| 208 } | 208 } |
| 209 | 209 |
| 210 bool SendAutomationJSONRequestWithDefaultTimeout( | 210 bool SendAutomationJSONRequestWithDefaultTimeout( |
| 211 AutomationMessageSender* sender, | 211 AutomationMessageSender* sender, |
| 212 const std::string& request, | 212 const std::string& request, |
| 213 std::string* reply, | 213 std::string* reply, |
| 214 bool* success) { | 214 bool* success) { |
| 215 return sender->Send(new AutomationMsg_SendJSONRequest( | 215 return sender->Send(new AutomationMsg_SendJSONRequestWithBrowserHandle( |
| 216 -1, request, reply, success)); | 216 -1, request, reply, success)); |
| 217 } | 217 } |
| 218 | 218 |
| 219 bool SendGetIndicesFromTabIdJSONRequest( | 219 bool SendGetIndicesFromTabIdJSONRequest( |
| 220 AutomationMessageSender* sender, | 220 AutomationMessageSender* sender, |
| 221 int tab_id, | 221 int tab_id, |
| 222 int* browser_index, | 222 int* browser_index, |
| 223 int* tab_index, | 223 int* tab_index, |
| 224 Error* error) { | 224 Error* error) { |
| 225 DictionaryValue request_dict; | 225 DictionaryValue request_dict; |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 933 | 933 |
| 934 bool SendOverrideGeolocationJSONRequest( | 934 bool SendOverrideGeolocationJSONRequest( |
| 935 AutomationMessageSender* sender, | 935 AutomationMessageSender* sender, |
| 936 base::DictionaryValue* geolocation, | 936 base::DictionaryValue* geolocation, |
| 937 Error* error) { | 937 Error* error) { |
| 938 scoped_ptr<DictionaryValue> dict(geolocation->DeepCopy()); | 938 scoped_ptr<DictionaryValue> dict(geolocation->DeepCopy()); |
| 939 dict->SetString("command", "OverrideGeoposition"); | 939 dict->SetString("command", "OverrideGeoposition"); |
| 940 DictionaryValue reply_dict; | 940 DictionaryValue reply_dict; |
| 941 return SendAutomationJSONRequest(sender, *dict.get(), &reply_dict, error); | 941 return SendAutomationJSONRequest(sender, *dict.get(), &reply_dict, error); |
| 942 } | 942 } |
| OLD | NEW |