| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 <oleacc.h> | 5 #include <oleacc.h> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/win/scoped_bstr.h" | 9 #include "base/win/scoped_bstr.h" |
| 10 #include "base/win/scoped_com_initializer.h" | 10 #include "base/win/scoped_com_initializer.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 static WinAccessibilityEventMonitor* instance_; | 76 static WinAccessibilityEventMonitor* instance_; |
| 77 | 77 |
| 78 DISALLOW_COPY_AND_ASSIGN(WinAccessibilityEventMonitor); | 78 DISALLOW_COPY_AND_ASSIGN(WinAccessibilityEventMonitor); |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 // static | 81 // static |
| 82 WinAccessibilityEventMonitor* WinAccessibilityEventMonitor::instance_ = NULL; | 82 WinAccessibilityEventMonitor* WinAccessibilityEventMonitor::instance_ = NULL; |
| 83 | 83 |
| 84 WinAccessibilityEventMonitor::WinAccessibilityEventMonitor( | 84 WinAccessibilityEventMonitor::WinAccessibilityEventMonitor( |
| 85 UINT event_min, UINT event_max) { | 85 UINT event_min, UINT event_max) { |
| 86 CHECK(!instance_) << "There can be only one instance of" | 86 // There can be only one instance of WinAccessibilityEventMonitor at a time. |
| 87 << " WinAccessibilityEventMonitor at a time."; | 87 CHECK(!instance_); |
| 88 instance_ = this; | 88 instance_ = this; |
| 89 win_event_hook_handle_ = SetWinEventHook( | 89 win_event_hook_handle_ = SetWinEventHook( |
| 90 event_min, | 90 event_min, |
| 91 event_max, | 91 event_max, |
| 92 NULL, | 92 NULL, |
| 93 &WinAccessibilityEventMonitor::WinEventHookThunk, | 93 &WinAccessibilityEventMonitor::WinEventHookThunk, |
| 94 GetCurrentProcessId(), | 94 GetCurrentProcessId(), |
| 95 0, // Hook all threads | 95 0, // Hook all threads |
| 96 WINEVENT_OUTOFCONTEXT); | 96 WINEVENT_OUTOFCONTEXT); |
| 97 } | 97 } |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 // second page. | 249 // second page. |
| 250 EXPECT_NE("First Page", name); | 250 EXPECT_NE("First Page", name); |
| 251 | 251 |
| 252 // Finish when we get an event on the second page. | 252 // Finish when we get an event on the second page. |
| 253 if (name == "This page is in English") { | 253 if (name == "This page is in English") { |
| 254 LOG(INFO) << "Got event on second page, finishing test."; | 254 LOG(INFO) << "Got event on second page, finishing test."; |
| 255 break; | 255 break; |
| 256 } | 256 } |
| 257 } | 257 } |
| 258 } | 258 } |
| OLD | NEW |