| 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 // TODO(dtapuska): Do not create a DirectManipulationHelper on any windows |
| 16 | 16 // versions as it only causes issues. High Precision Touchpad events seem to |
| 17 if (base::win::GetVersion() >= base::win::VERSION_WIN10) | 17 // always be sent to apps with recent Windows 10 versions. This class should |
| 18 instance.reset(new DirectManipulationHelper); | 18 // eventually be removed. See crbug.com/647038. |
| 19 | 19 return nullptr; |
| 20 return instance; | |
| 21 } | 20 } |
| 22 | 21 |
| 23 DirectManipulationHelper::DirectManipulationHelper() {} | 22 DirectManipulationHelper::DirectManipulationHelper() {} |
| 24 | 23 |
| 25 DirectManipulationHelper::~DirectManipulationHelper() { | 24 DirectManipulationHelper::~DirectManipulationHelper() { |
| 26 if (view_port_outer_) | 25 if (view_port_outer_) |
| 27 view_port_outer_->Abandon(); | 26 view_port_outer_->Abandon(); |
| 28 } | 27 } |
| 29 | 28 |
| 30 void DirectManipulationHelper::Initialize(HWND window) { | 29 void DirectManipulationHelper::Initialize(HWND window) { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 HRESULT hr = view_port_outer_->SetContact(DIRECTMANIPULATION_MOUSEFOCUS); | 107 HRESULT hr = view_port_outer_->SetContact(DIRECTMANIPULATION_MOUSEFOCUS); |
| 109 if (SUCCEEDED(hr)) { | 108 if (SUCCEEDED(hr)) { |
| 110 BOOL handled = FALSE; | 109 BOOL handled = FALSE; |
| 111 manager_->ProcessInput(&msg, &handled); | 110 manager_->ProcessInput(&msg, &handled); |
| 112 view_port_outer_->ReleaseContact(DIRECTMANIPULATION_MOUSEFOCUS); | 111 view_port_outer_->ReleaseContact(DIRECTMANIPULATION_MOUSEFOCUS); |
| 113 } | 112 } |
| 114 } | 113 } |
| 115 | 114 |
| 116 } // namespace win. | 115 } // namespace win. |
| 117 } // namespace gfx. | 116 } // namespace gfx. |
| OLD | NEW |