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

Side by Side Diff: ui/aura/window_tree_host_x11.cc

Issue 684483002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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/aura/window_tree_host_x11.h ('k') | ui/aura/window_unittest.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/aura/window_tree_host_x11.h" 5 #include "ui/aura/window_tree_host_x11.h"
6 6
7 #include <strings.h> 7 #include <strings.h>
8 #include <X11/cursorfont.h> 8 #include <X11/cursorfont.h>
9 #include <X11/extensions/XInput2.h> 9 #include <X11/extensions/XInput2.h>
10 #include <X11/extensions/Xrandr.h> 10 #include <X11/extensions/Xrandr.h>
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 if (!base::StringToInt(parts[1], &right_)) 126 if (!base::StringToInt(parts[1], &right_))
127 DLOG(ERROR) << "Incorrect right border calibration value passed."; 127 DLOG(ERROR) << "Incorrect right border calibration value passed.";
128 if (!base::StringToInt(parts[2], &top_)) 128 if (!base::StringToInt(parts[2], &top_))
129 DLOG(ERROR) << "Incorrect top border calibration value passed."; 129 DLOG(ERROR) << "Incorrect top border calibration value passed.";
130 if (!base::StringToInt(parts[3], &bottom_)) 130 if (!base::StringToInt(parts[3], &bottom_))
131 DLOG(ERROR) << "Incorrect bottom border calibration value passed."; 131 DLOG(ERROR) << "Incorrect bottom border calibration value passed.";
132 } 132 }
133 #endif // defined(USE_XI2_MT) 133 #endif // defined(USE_XI2_MT)
134 } 134 }
135 135
136 virtual ~TouchEventCalibrate() { 136 ~TouchEventCalibrate() override {
137 if (ui::PlatformEventSource::GetInstance()) 137 if (ui::PlatformEventSource::GetInstance())
138 ui::PlatformEventSource::GetInstance()->RemovePlatformEventObserver(this); 138 ui::PlatformEventSource::GetInstance()->RemovePlatformEventObserver(this);
139 } 139 }
140 140
141 // Modify the location of the |event|, 141 // Modify the location of the |event|,
142 // expanding it from |bounds| to (|bounds| + bezels). 142 // expanding it from |bounds| to (|bounds| + bezels).
143 // Required when touchscreen is bigger than screen (i.e. has bezels), 143 // Required when touchscreen is bigger than screen (i.e. has bezels),
144 // because we receive events in touchscreen coordinates, 144 // because we receive events in touchscreen coordinates,
145 // which need to be expanded when converting to screen coordinates, 145 // which need to be expanded when converting to screen coordinates,
146 // so that location on bezels will be outside of screen area. 146 // so that location on bezels will be outside of screen area.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 // Usually those will be equal, 195 // Usually those will be equal,
196 // if not, I am not sure what the correct value should be. 196 // if not, I am not sure what the correct value should be.
197 event->set_root_location(gfx::Point(x, y)); 197 event->set_root_location(gfx::Point(x, y));
198 } 198 }
199 event->set_location(gfx::Point(x, y)); 199 event->set_location(gfx::Point(x, y));
200 #endif // defined(USE_XI2_MT) 200 #endif // defined(USE_XI2_MT)
201 } 201 }
202 202
203 private: 203 private:
204 // ui::PlatformEventObserver: 204 // ui::PlatformEventObserver:
205 virtual void WillProcessEvent(const ui::PlatformEvent& event) override { 205 void WillProcessEvent(const ui::PlatformEvent& event) override {
206 #if defined(USE_XI2_MT) 206 #if defined(USE_XI2_MT)
207 if (event->type == GenericEvent && 207 if (event->type == GenericEvent &&
208 (event->xgeneric.evtype == XI_TouchBegin || 208 (event->xgeneric.evtype == XI_TouchBegin ||
209 event->xgeneric.evtype == XI_TouchUpdate || 209 event->xgeneric.evtype == XI_TouchUpdate ||
210 event->xgeneric.evtype == XI_TouchEnd)) { 210 event->xgeneric.evtype == XI_TouchEnd)) {
211 XIDeviceEvent* xievent = static_cast<XIDeviceEvent*>(event->xcookie.data); 211 XIDeviceEvent* xievent = static_cast<XIDeviceEvent*>(event->xcookie.data);
212 xievent->event = xievent->root; 212 xievent->event = xievent->root;
213 xievent->event_x = xievent->root_x; 213 xievent->event_x = xievent->root_x;
214 xievent->event_y = xievent->root_y; 214 xievent->event_y = xievent->root_y;
215 } 215 }
216 #endif // defined(USE_XI2_MT) 216 #endif // defined(USE_XI2_MT)
217 } 217 }
218 218
219 virtual void DidProcessEvent(const ui::PlatformEvent& event) override {} 219 void DidProcessEvent(const ui::PlatformEvent& event) override {}
220 220
221 // The difference in screen's native resolution pixels between 221 // The difference in screen's native resolution pixels between
222 // the border of the touchscreen and the border of the screen, 222 // the border of the touchscreen and the border of the screen,
223 // aka bezel sizes. 223 // aka bezel sizes.
224 int left_; 224 int left_;
225 int right_; 225 int right_;
226 int top_; 226 int top_;
227 int bottom_; 227 int bottom_;
228 228
229 DISALLOW_COPY_AND_ASSIGN(TouchEventCalibrate); 229 DISALLOW_COPY_AND_ASSIGN(TouchEventCalibrate);
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 } 727 }
728 728
729 namespace test { 729 namespace test {
730 730
731 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { 731 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) {
732 default_override_redirect = override_redirect; 732 default_override_redirect = override_redirect;
733 } 733 }
734 734
735 } // namespace test 735 } // namespace test
736 } // namespace aura 736 } // namespace aura
OLDNEW
« no previous file with comments | « ui/aura/window_tree_host_x11.h ('k') | ui/aura/window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698