Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ui/gfx/win/direct_manipulation.h" | 5 #include "ui/gfx/win/direct_manipulation.h" |
| 6 | 6 |
| 7 #include "base/win/windows_version.h" | 7 #include "base/win/windows_version.h" |
| 8 | 8 |
| 9 namespace gfx { | 9 namespace gfx { |
| 10 namespace win { | 10 namespace win { |
| 11 | 11 |
| 12 // static | 12 // static |
| 13 std::unique_ptr<DirectManipulationHelper> | 13 std::unique_ptr<DirectManipulationHelper> |
| 14 DirectManipulationHelper::CreateInstance() { | 14 DirectManipulationHelper::CreateInstance() { |
| 15 std::unique_ptr<DirectManipulationHelper> instance; | 15 std::unique_ptr<DirectManipulationHelper> instance; |
| 16 | 16 |
| 17 if (base::win::GetVersion() >= base::win::VERSION_WIN10) | 17 // TODO(dtapuska): Remove the Direct Manipulation code it only causes |
|
sky
2017/05/08 21:45:57
How about changing this function to unconditionall
dtapuska
2017/05/09 13:32:31
Done.
| |
| 18 // issues. High Precision Touchpad events seem to always be sent to | |
| 19 // apps with recent Windows 10 versions. (crbug.com/647038) | |
| 20 if (false && base::win::GetVersion() >= base::win::VERSION_WIN10) | |
| 18 instance.reset(new DirectManipulationHelper); | 21 instance.reset(new DirectManipulationHelper); |
| 19 | |
| 20 return instance; | 22 return instance; |
| 21 } | 23 } |
| 22 | 24 |
| 23 DirectManipulationHelper::DirectManipulationHelper() {} | 25 DirectManipulationHelper::DirectManipulationHelper() {} |
| 24 | 26 |
| 25 DirectManipulationHelper::~DirectManipulationHelper() { | 27 DirectManipulationHelper::~DirectManipulationHelper() { |
| 26 if (view_port_outer_) | 28 if (view_port_outer_) |
| 27 view_port_outer_->Abandon(); | 29 view_port_outer_->Abandon(); |
| 28 } | 30 } |
| 29 | 31 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 108 HRESULT hr = view_port_outer_->SetContact(DIRECTMANIPULATION_MOUSEFOCUS); | 110 HRESULT hr = view_port_outer_->SetContact(DIRECTMANIPULATION_MOUSEFOCUS); |
| 109 if (SUCCEEDED(hr)) { | 111 if (SUCCEEDED(hr)) { |
| 110 BOOL handled = FALSE; | 112 BOOL handled = FALSE; |
| 111 manager_->ProcessInput(&msg, &handled); | 113 manager_->ProcessInput(&msg, &handled); |
| 112 view_port_outer_->ReleaseContact(DIRECTMANIPULATION_MOUSEFOCUS); | 114 view_port_outer_->ReleaseContact(DIRECTMANIPULATION_MOUSEFOCUS); |
| 113 } | 115 } |
| 114 } | 116 } |
| 115 | 117 |
| 116 } // namespace win. | 118 } // namespace win. |
| 117 } // namespace gfx. | 119 } // namespace gfx. |
| OLD | NEW |