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

Side by Side Diff: ui/events/event_utils.cc

Issue 134773004: Include external touchscreen vid/pid in UMA hardware profile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address oshima's comments. Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « ui/events/event_utils.h ('k') | ui/events/x/touch_factory_x11.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/events/event_utils.h" 5 #include "ui/events/event_utils.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ui/events/event.h" 9 #include "ui/events/event.h"
10 #include "ui/gfx/display.h" 10 #include "ui/gfx/display.h"
11 #include "ui/gfx/screen.h" 11 #include "ui/gfx/screen.h"
12 12
13 namespace ui { 13 namespace ui {
14 14
15 namespace { 15 namespace {
16 int g_custom_event_types = ET_LAST; 16 int g_custom_event_types = ET_LAST;
17 } // namespace 17 } // namespace
18 18
19 int RegisterCustomEventType() { 19 int RegisterCustomEventType() {
20 return ++g_custom_event_types; 20 return ++g_custom_event_types;
21 } 21 }
22 22
23 base::TimeDelta EventTimeForNow() { 23 base::TimeDelta EventTimeForNow() {
24 return base::TimeDelta::FromInternalValue( 24 return base::TimeDelta::FromInternalValue(
25 base::TimeTicks::Now().ToInternalValue()); 25 base::TimeTicks::Now().ToInternalValue());
26 } 26 }
27 27
28 bool ShouldDefaultToNaturalScroll() { 28 bool ShouldDefaultToNaturalScroll() {
29 return InternalDisplaySupportsTouch() ==
30 gfx::Display::TOUCH_SUPPORT_AVAILABLE;
31 }
32
33 gfx::Display::TouchSupport InternalDisplaySupportsTouch() {
oshima 2014/01/17 20:49:47 GetInternalDisplayTouchSupport() ?
tdresser 2014/01/17 21:34:54 Done.
29 gfx::Screen* screen = gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE); 34 gfx::Screen* screen = gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE);
30 if (!screen) 35 CHECK(screen);
31 return false;
32 const std::vector<gfx::Display>& displays = screen->GetAllDisplays(); 36 const std::vector<gfx::Display>& displays = screen->GetAllDisplays();
33 for (std::vector<gfx::Display>::const_iterator it = displays.begin(); 37 for (std::vector<gfx::Display>::const_iterator it = displays.begin();
34 it != displays.end(); ++it) { 38 it != displays.end(); ++it) {
35 const gfx::Display& display = *it; 39 if (it->IsInternal())
36 if (display.IsInternal() && 40 return it->touch_support();
37 display.touch_support() == gfx::Display::TOUCH_SUPPORT_AVAILABLE)
38 return true;
39 } 41 }
40 return false; 42 return gfx::Display::TOUCH_SUPPORT_UNAVAILABLE;
41 } 43 }
42 44
43 } // namespace ui 45 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/event_utils.h ('k') | ui/events/x/touch_factory_x11.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698