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

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

Issue 854713003: More old files deletion. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix tryjobs? Created 5 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
« no previous file with comments | « ui/events/event_utils.h ('k') | ui/events/gesture_detection/gesture_config_helper_aura.cc » ('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"
12 11
13 namespace ui { 12 namespace ui {
14 13
15 namespace { 14 namespace {
16 int g_custom_event_types = ET_LAST; 15 int g_custom_event_types = ET_LAST;
17 } // namespace 16 } // namespace
18 17
19 scoped_ptr<Event> EventFromNative(const base::NativeEvent& native_event) { 18 scoped_ptr<Event> EventFromNative(const base::NativeEvent& native_event) {
20 scoped_ptr<Event> event; 19 scoped_ptr<Event> event;
21 EventType type = EventTypeFromNative(native_event); 20 EventType type = EventTypeFromNative(native_event);
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 109
111 int RegisterCustomEventType() { 110 int RegisterCustomEventType() {
112 return ++g_custom_event_types; 111 return ++g_custom_event_types;
113 } 112 }
114 113
115 base::TimeDelta EventTimeForNow() { 114 base::TimeDelta EventTimeForNow() {
116 return base::TimeDelta::FromInternalValue( 115 return base::TimeDelta::FromInternalValue(
117 base::TimeTicks::Now().ToInternalValue()); 116 base::TimeTicks::Now().ToInternalValue());
118 } 117 }
119 118
120 bool ShouldDefaultToNaturalScroll() {
121 return GetInternalDisplayTouchSupport() ==
122 gfx::Display::TOUCH_SUPPORT_AVAILABLE;
123 }
124
125 gfx::Display::TouchSupport GetInternalDisplayTouchSupport() {
126 gfx::Screen* screen = gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE);
127 // No screen in some unit tests.
128 if (!screen)
129 return gfx::Display::TOUCH_SUPPORT_UNKNOWN;
130 const std::vector<gfx::Display>& displays = screen->GetAllDisplays();
131 for (std::vector<gfx::Display>::const_iterator it = displays.begin();
132 it != displays.end(); ++it) {
133 if (it->IsInternal())
134 return it->touch_support();
135 }
136 return gfx::Display::TOUCH_SUPPORT_UNAVAILABLE;
137 }
138
139 } // namespace ui 119 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/event_utils.h ('k') | ui/events/gesture_detection/gesture_config_helper_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698