| 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/win/win_util.h" | 10 #include "base/win/win_util.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 if (base::win::GetVersion() >= base::win::VERSION_WIN7) | 114 if (base::win::GetVersion() >= base::win::VERSION_WIN7) |
| 115 RegisterTouchWindow(hwnd(), TWF_WANTPALM); | 115 RegisterTouchWindow(hwnd(), TWF_WANTPALM); |
| 116 | 116 |
| 117 HRESULT hr = ::CreateStdAccessibleObject( | 117 HRESULT hr = ::CreateStdAccessibleObject( |
| 118 hwnd(), OBJID_WINDOW, IID_IAccessible, | 118 hwnd(), OBJID_WINDOW, IID_IAccessible, |
| 119 reinterpret_cast<void **>(window_accessible_.Receive())); | 119 reinterpret_cast<void **>(window_accessible_.Receive())); |
| 120 DCHECK(SUCCEEDED(hr)); | 120 DCHECK(SUCCEEDED(hr)); |
| 121 | 121 |
| 122 AccessibilityMode mode = | 122 AccessibilityMode mode = |
| 123 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode(); | 123 BrowserAccessibilityStateImpl::GetInstance()->accessibility_mode(); |
| 124 if (!(mode & ACCESSIBILITY_MODE_FLAG_NATIVE_APIS)) { | 124 if (!(mode & AccessibilityMode::NATIVE_APIS)) { |
| 125 // Attempt to detect screen readers or other clients who want full | 125 // Attempt to detect screen readers or other clients who want full |
| 126 // accessibility support, by seeing if they respond to this event. | 126 // accessibility support, by seeing if they respond to this event. |
| 127 NotifyWinEvent(EVENT_SYSTEM_ALERT, hwnd(), kIdScreenReaderHoneyPot, | 127 NotifyWinEvent(EVENT_SYSTEM_ALERT, hwnd(), kIdScreenReaderHoneyPot, |
| 128 CHILDID_SELF); | 128 CHILDID_SELF); |
| 129 } | 129 } |
| 130 | 130 |
| 131 // Direct Manipulation is enabled on Windows 10+. The CreateInstance function | 131 // Direct Manipulation is enabled on Windows 10+. The CreateInstance function |
| 132 // returns NULL if Direct Manipulation is not available. | 132 // returns NULL if Direct Manipulation is not available. |
| 133 direct_manipulation_helper_ = | 133 direct_manipulation_helper_ = |
| 134 gfx::win::DirectManipulationHelper::CreateInstance(); | 134 gfx::win::DirectManipulationHelper::CreateInstance(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 159 LPARAM l_param) { | 159 LPARAM l_param) { |
| 160 // Only the lower 32 bits of l_param are valid when checking the object id | 160 // Only the lower 32 bits of l_param are valid when checking the object id |
| 161 // because it sometimes gets sign-extended incorrectly (but not always). | 161 // because it sometimes gets sign-extended incorrectly (but not always). |
| 162 DWORD obj_id = static_cast<DWORD>(static_cast<DWORD_PTR>(l_param)); | 162 DWORD obj_id = static_cast<DWORD>(static_cast<DWORD_PTR>(l_param)); |
| 163 | 163 |
| 164 if (kIdScreenReaderHoneyPot == obj_id) { | 164 if (kIdScreenReaderHoneyPot == obj_id) { |
| 165 // When an MSAA client has responded to our fake event on this id, | 165 // When an MSAA client has responded to our fake event on this id, |
| 166 // enable basic accessibility support. (Full screen reader support is | 166 // enable basic accessibility support. (Full screen reader support is |
| 167 // detected later when specific more advanced APIs are accessed.) | 167 // detected later when specific more advanced APIs are accessed.) |
| 168 BrowserAccessibilityStateImpl::GetInstance()->AddAccessibilityModeFlags( | 168 BrowserAccessibilityStateImpl::GetInstance()->AddAccessibilityModeFlags( |
| 169 ACCESSIBILITY_MODE_FLAG_NATIVE_APIS | | 169 AccessibilityMode::NATIVE_APIS | AccessibilityMode::WEB_CONTENTS); |
| 170 ACCESSIBILITY_MODE_FLAG_WEB_CONTENTS); | |
| 171 return static_cast<LRESULT>(0L); | 170 return static_cast<LRESULT>(0L); |
| 172 } | 171 } |
| 173 | 172 |
| 174 if (static_cast<DWORD>(OBJID_CLIENT) != obj_id || !host_) | 173 if (static_cast<DWORD>(OBJID_CLIENT) != obj_id || !host_) |
| 175 return static_cast<LRESULT>(0L); | 174 return static_cast<LRESULT>(0L); |
| 176 | 175 |
| 177 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From( | 176 RenderWidgetHostImpl* rwhi = RenderWidgetHostImpl::From( |
| 178 host_->GetRenderWidgetHost()); | 177 host_->GetRenderWidgetHost()); |
| 179 if (!rwhi) | 178 if (!rwhi) |
| 180 return static_cast<LRESULT>(0L); | 179 return static_cast<LRESULT>(0L); |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 direct_manipulation_helper_->Activate(hwnd()); | 408 direct_manipulation_helper_->Activate(hwnd()); |
| 410 } else if (window_pos->flags & SWP_HIDEWINDOW) { | 409 } else if (window_pos->flags & SWP_HIDEWINDOW) { |
| 411 direct_manipulation_helper_->Deactivate(hwnd()); | 410 direct_manipulation_helper_->Deactivate(hwnd()); |
| 412 } | 411 } |
| 413 } | 412 } |
| 414 SetMsgHandled(FALSE); | 413 SetMsgHandled(FALSE); |
| 415 return 0; | 414 return 0; |
| 416 } | 415 } |
| 417 | 416 |
| 418 } // namespace content | 417 } // namespace content |
| OLD | NEW |