| 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/test/automation/automation_json_requests.h" | 5 #include "chrome/test/automation/automation_json_requests.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 dict.SetInteger("nativeKeyCode", key_event.key_code); | 442 dict.SetInteger("nativeKeyCode", key_event.key_code); |
| 443 dict.SetInteger("windowsKeyCode", key_event.key_code); | 443 dict.SetInteger("windowsKeyCode", key_event.key_code); |
| 444 dict.SetString("unmodifiedText", key_event.unmodified_text); | 444 dict.SetString("unmodifiedText", key_event.unmodified_text); |
| 445 dict.SetString("text", key_event.modified_text); | 445 dict.SetString("text", key_event.modified_text); |
| 446 dict.SetInteger("modifiers", key_event.modifiers); | 446 dict.SetInteger("modifiers", key_event.modifiers); |
| 447 dict.SetBoolean("isSystemKey", false); | 447 dict.SetBoolean("isSystemKey", false); |
| 448 DictionaryValue reply_dict; | 448 DictionaryValue reply_dict; |
| 449 return SendAutomationJSONRequest(sender, dict, &reply_dict); | 449 return SendAutomationJSONRequest(sender, dict, &reply_dict); |
| 450 } | 450 } |
| 451 | 451 |
| 452 bool SendNativeKeyEventJSONRequest( |
| 453 AutomationMessageSender* sender, |
| 454 int browser_index, |
| 455 int tab_index, |
| 456 ui::KeyboardCode key_code, |
| 457 int modifiers) { |
| 458 DictionaryValue dict; |
| 459 dict.SetString("command", "SendOSLevelKeyEventToTab"); |
| 460 dict.SetInteger("windex", browser_index); |
| 461 dict.SetInteger("tab_index", tab_index); |
| 462 dict.SetInteger("keyCode", key_code); |
| 463 dict.SetInteger("modifiers", modifiers); |
| 464 DictionaryValue reply_dict; |
| 465 return SendAutomationJSONRequest(sender, dict, &reply_dict); |
| 466 } |
| 467 |
| 452 bool SendWaitForAllTabsToStopLoadingJSONRequest( | 468 bool SendWaitForAllTabsToStopLoadingJSONRequest( |
| 453 AutomationMessageSender* sender) { | 469 AutomationMessageSender* sender) { |
| 454 DictionaryValue dict; | 470 DictionaryValue dict; |
| 455 dict.SetString("command", "WaitForAllTabsToStopLoading"); | 471 dict.SetString("command", "WaitForAllTabsToStopLoading"); |
| 456 DictionaryValue reply_dict; | 472 DictionaryValue reply_dict; |
| 457 return SendAutomationJSONRequest(sender, dict, &reply_dict); | 473 return SendAutomationJSONRequest(sender, dict, &reply_dict); |
| 458 } | 474 } |
| OLD | NEW |