Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(560)

Side by Side Diff: ash/touch/touchscreen_util.cc

Issue 618283003: Adds special support to the device manager for keyboards devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to master. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "ash/touch/touchscreen_util.h" 5 #include "ash/touch/touchscreen_util.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/events/input_device.h"
10 11
11 namespace ash { 12 namespace ash {
12 13
13 void AssociateTouchscreens(std::vector<DisplayInfo>* displays, 14 void AssociateTouchscreens(std::vector<DisplayInfo>* displays,
14 const std::vector<ui::TouchscreenDevice>& devices) { 15 const std::vector<ui::TouchscreenDevice>& devices) {
15 std::set<int> no_match_touchscreen; 16 std::set<int> no_match_touchscreen;
16 int internal_touchscreen = -1; 17 int internal_touchscreen = -1;
17 for (size_t i = 0; i < devices.size(); ++i) { 18 for (size_t i = 0; i < devices.size(); ++i) {
18 if (devices[i].is_internal) { 19 if (devices[i].type == ui::InputDeviceType::INPUT_DEVICE_INTERNAL) {
19 internal_touchscreen = i; 20 internal_touchscreen = i;
20 break; 21 break;
21 } 22 }
22 } 23 }
23 24
24 DisplayInfo* internal_state = NULL; 25 DisplayInfo* internal_state = NULL;
25 for (size_t i = 0; i < displays->size(); ++i) { 26 for (size_t i = 0; i < displays->size(); ++i) {
26 DisplayInfo* state = &(*displays)[i]; 27 DisplayInfo* state = &(*displays)[i];
27 if (state->id() == gfx::Display::InternalDisplayId() && 28 if (state->id() == gfx::Display::InternalDisplayId() &&
28 !state->GetNativeModeSize().IsEmpty() && 29 !state->GetNativeModeSize().IsEmpty() &&
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 state->set_touch_support(gfx::Display::TOUCH_SUPPORT_AVAILABLE); 95 state->set_touch_support(gfx::Display::TOUCH_SUPPORT_AVAILABLE);
95 VLOG(2) << "Arbitrarily matching touchscreen " 96 VLOG(2) << "Arbitrarily matching touchscreen "
96 << state->touch_device_id() << " to display " << state->id(); 97 << state->touch_device_id() << " to display " << state->id();
97 break; 98 break;
98 } 99 }
99 } 100 }
100 } 101 }
101 } 102 }
102 103
103 } // namespace ash 104 } // namespace ash
OLDNEW
« no previous file with comments | « ash/touch/touch_transformer_controller_unittest.cc ('k') | ash/touch/touchscreen_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698