OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "ui/display/chromeos/touchscreen_delegate_impl.h" | 5 #include "ui/display/chromeos/touchscreen_delegate_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "ui/display/types/chromeos/display_mode.h" | 10 #include "ui/display/types/chromeos/display_mode.h" |
11 #include "ui/display/types/chromeos/display_snapshot.h" | 11 #include "ui/display/types/chromeos/display_snapshot.h" |
12 #include "ui/display/types/chromeos/touchscreen_device_manager.h" | 12 #include "ui/events/device_data_manager.h" |
13 | 13 |
14 namespace ui { | 14 namespace ui { |
15 | 15 |
16 TouchscreenDelegateImpl::TouchscreenDelegateImpl( | 16 TouchscreenDelegateImpl::TouchscreenDelegateImpl() { |
17 scoped_ptr<TouchscreenDeviceManager> touch_device_manager) | 17 } |
18 : touch_device_manager_(touch_device_manager.Pass()) {} | |
19 | 18 |
20 TouchscreenDelegateImpl::~TouchscreenDelegateImpl() {} | 19 TouchscreenDelegateImpl::~TouchscreenDelegateImpl() {} |
21 | 20 |
22 void TouchscreenDelegateImpl::AssociateTouchscreens( | 21 void TouchscreenDelegateImpl::AssociateTouchscreens( |
23 std::vector<DisplayConfigurator::DisplayState>* displays) { | 22 std::vector<DisplayConfigurator::DisplayState>* displays) { |
24 std::set<int> no_match_touchscreen; | 23 std::set<int> no_match_touchscreen; |
25 std::vector<TouchscreenDevice> devices = touch_device_manager_->GetDevices(); | 24 std::vector<TouchscreenDevice> devices = |
Daniel Erat
2014/09/10 19:12:50
oh, and if you don't actually need to make a copy
dnicoara
2014/09/10 19:24:25
Done.
| |
25 DeviceDataManager::GetInstance()->touchscreen_devices(); | |
26 | 26 |
27 int internal_touchscreen = -1; | 27 int internal_touchscreen = -1; |
28 for (size_t i = 0; i < devices.size(); ++i) { | 28 for (size_t i = 0; i < devices.size(); ++i) { |
29 if (devices[i].is_internal) { | 29 if (devices[i].is_internal) { |
30 internal_touchscreen = i; | 30 internal_touchscreen = i; |
31 break; | 31 break; |
32 } | 32 } |
33 } | 33 } |
34 | 34 |
35 DisplayConfigurator::DisplayState* internal_state = NULL; | 35 DisplayConfigurator::DisplayState* internal_state = NULL; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
103 VLOG(2) << "Arbitrarily matching touchscreen " | 103 VLOG(2) << "Arbitrarily matching touchscreen " |
104 << state->touch_device_id << " to display " | 104 << state->touch_device_id << " to display " |
105 << state->display->display_id(); | 105 << state->display->display_id(); |
106 break; | 106 break; |
107 } | 107 } |
108 } | 108 } |
109 } | 109 } |
110 } | 110 } |
111 | 111 |
112 } // namespace ui | 112 } // namespace ui |
OLD | NEW |