| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "win8/test/ui_automation_client.h" | 5 #include "win8/test/ui_automation_client.h" |
| 6 | 6 |
| 7 #include <atlbase.h> | 7 #include <atlbase.h> |
| 8 #include <atlcom.h> | 8 #include <atlcom.h> |
| 9 #include <oleauto.h> | 9 #include <oleauto.h> |
| 10 #include <stdint.h> |
| 10 #include <uiautomation.h> | 11 #include <uiautomation.h> |
| 11 | 12 |
| 12 #include <algorithm> | 13 #include <algorithm> |
| 13 | 14 |
| 14 #include "base/bind.h" | 15 #include "base/bind.h" |
| 15 #include "base/callback.h" | 16 #include "base/callback.h" |
| 17 #include "base/macros.h" |
| 16 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" |
| 17 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
| 18 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
| 19 #include "base/thread_task_runner_handle.h" | 21 #include "base/thread_task_runner_handle.h" |
| 20 #include "base/win/scoped_comptr.h" | 22 #include "base/win/scoped_comptr.h" |
| 21 #include "base/win/scoped_variant.h" | 23 #include "base/win/scoped_variant.h" |
| 22 | 24 |
| 23 namespace win8 { | 25 namespace win8 { |
| 24 namespace internal { | 26 namespace internal { |
| 25 | 27 |
| (...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 } | 569 } |
| 568 | 570 |
| 569 if (V_VT(var.ptr()) != VT_I4) { | 571 if (V_VT(var.ptr()) != VT_I4) { |
| 570 LOG(ERROR) << __FUNCTION__ | 572 LOG(ERROR) << __FUNCTION__ |
| 571 << " window handle is not an int: " << V_VT(var.ptr()); | 573 << " window handle is not an int: " << V_VT(var.ptr()); |
| 572 return; | 574 return; |
| 573 } | 575 } |
| 574 | 576 |
| 575 HWND handle = reinterpret_cast<HWND>(V_I4(var.ptr())); | 577 HWND handle = reinterpret_cast<HWND>(V_I4(var.ptr())); |
| 576 | 578 |
| 577 uint32 scan_code = MapVirtualKey(VK_ESCAPE, MAPVK_VK_TO_VSC); | 579 uint32_t scan_code = MapVirtualKey(VK_ESCAPE, MAPVK_VK_TO_VSC); |
| 578 PostMessage(handle, WM_KEYDOWN, VK_ESCAPE, | 580 PostMessage(handle, WM_KEYDOWN, VK_ESCAPE, |
| 579 MAKELPARAM(1, scan_code)); | 581 MAKELPARAM(1, scan_code)); |
| 580 PostMessage(handle, WM_KEYUP, VK_ESCAPE, | 582 PostMessage(handle, WM_KEYUP, VK_ESCAPE, |
| 581 MAKELPARAM(1, scan_code | KF_REPEAT | KF_UP)); | 583 MAKELPARAM(1, scan_code | KF_REPEAT | KF_UP)); |
| 582 } | 584 } |
| 583 | 585 |
| 584 UIAutomationClient::UIAutomationClient() | 586 UIAutomationClient::UIAutomationClient() |
| 585 : automation_thread_("UIAutomation") {} | 587 : automation_thread_("UIAutomation") {} |
| 586 | 588 |
| 587 UIAutomationClient::~UIAutomationClient() { | 589 UIAutomationClient::~UIAutomationClient() { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 613 context_, | 615 context_, |
| 614 base::ThreadTaskRunnerHandle::Get(), | 616 base::ThreadTaskRunnerHandle::Get(), |
| 615 base::string16(class_name), | 617 base::string16(class_name), |
| 616 item_name, | 618 item_name, |
| 617 init_callback, | 619 init_callback, |
| 618 result_callback)); | 620 result_callback)); |
| 619 } | 621 } |
| 620 | 622 |
| 621 } // namespace internal | 623 } // namespace internal |
| 622 } // namespace win8 | 624 } // namespace win8 |
| OLD | NEW |