OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 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 "content/browser/renderer_host/legacy_render_widget_host_win.h" | 5 #include "content/browser/renderer_host/legacy_render_widget_host_win.h" |
6 | 6 |
| 7 #include <objbase.h> |
| 8 |
7 #include <memory> | 9 #include <memory> |
8 | 10 |
9 #include "base/command_line.h" | 11 #include "base/command_line.h" |
10 #include "base/win/win_util.h" | 12 #include "base/win/win_util.h" |
11 #include "base/win/windows_version.h" | 13 #include "base/win/windows_version.h" |
12 #include "content/browser/accessibility/browser_accessibility_manager_win.h" | 14 #include "content/browser/accessibility/browser_accessibility_manager_win.h" |
13 #include "content/browser/accessibility/browser_accessibility_state_impl.h" | 15 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
14 #include "content/browser/accessibility/browser_accessibility_win.h" | 16 #include "content/browser/accessibility/browser_accessibility_win.h" |
15 #include "content/browser/renderer_host/render_widget_host_impl.h" | 17 #include "content/browser/renderer_host/render_widget_host_impl.h" |
16 #include "content/browser/renderer_host/render_widget_host_view_aura.h" | 18 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 } | 109 } |
108 | 110 |
109 LegacyRenderWidgetHostHWND::~LegacyRenderWidgetHostHWND() { | 111 LegacyRenderWidgetHostHWND::~LegacyRenderWidgetHostHWND() { |
110 DCHECK(!::IsWindow(hwnd())); | 112 DCHECK(!::IsWindow(hwnd())); |
111 } | 113 } |
112 | 114 |
113 bool LegacyRenderWidgetHostHWND::Init() { | 115 bool LegacyRenderWidgetHostHWND::Init() { |
114 if (base::win::GetVersion() >= base::win::VERSION_WIN7) | 116 if (base::win::GetVersion() >= base::win::VERSION_WIN7) |
115 RegisterTouchWindow(hwnd(), TWF_WANTPALM); | 117 RegisterTouchWindow(hwnd(), TWF_WANTPALM); |
116 | 118 |
117 HRESULT hr = ::CreateStdAccessibleObject( | 119 HRESULT hr = ::CreateStdAccessibleObject(hwnd(), OBJID_WINDOW, |
118 hwnd(), OBJID_WINDOW, IID_IAccessible, | 120 IID_PPV_ARGS(&window_accessible_)); |
119 reinterpret_cast<void **>(window_accessible_.Receive())); | |
120 DCHECK(SUCCEEDED(hr)); | 121 DCHECK(SUCCEEDED(hr)); |
121 | 122 |
122 AccessibilityMode mode = | 123 AccessibilityMode mode = |
123 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode(); | 124 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode(); |
124 if (!mode.has_mode(AccessibilityMode::kNativeAPIs)) { | 125 if (!mode.has_mode(AccessibilityMode::kNativeAPIs)) { |
125 // Attempt to detect screen readers or other clients who want full | 126 // Attempt to detect screen readers or other clients who want full |
126 // accessibility support, by seeing if they respond to this event. | 127 // accessibility support, by seeing if they respond to this event. |
127 NotifyWinEvent(EVENT_SYSTEM_ALERT, hwnd(), kIdScreenReaderHoneyPot, | 128 NotifyWinEvent(EVENT_SYSTEM_ALERT, hwnd(), kIdScreenReaderHoneyPot, |
128 CHILDID_SELF); | 129 CHILDID_SELF); |
129 } | 130 } |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 direct_manipulation_helper_->Activate(hwnd()); | 422 direct_manipulation_helper_->Activate(hwnd()); |
422 } else if (window_pos->flags & SWP_HIDEWINDOW) { | 423 } else if (window_pos->flags & SWP_HIDEWINDOW) { |
423 direct_manipulation_helper_->Deactivate(hwnd()); | 424 direct_manipulation_helper_->Deactivate(hwnd()); |
424 } | 425 } |
425 } | 426 } |
426 SetMsgHandled(FALSE); | 427 SetMsgHandled(FALSE); |
427 return 0; | 428 return 0; |
428 } | 429 } |
429 | 430 |
430 } // namespace content | 431 } // namespace content |
OLD | NEW |