OLD | NEW |
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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 // routes all the touch events to the X root window, | 109 // routes all the touch events to the X root window, |
110 // where they can be calibrated later. | 110 // where they can be calibrated later. |
111 // 2. Has the Calibrate method that does the actual bezel calibration, | 111 // 2. Has the Calibrate method that does the actual bezel calibration, |
112 // when invoked from X root window's event dispatcher. | 112 // when invoked from X root window's event dispatcher. |
113 class TouchEventCalibrate : public ui::PlatformEventObserver { | 113 class TouchEventCalibrate : public ui::PlatformEventObserver { |
114 public: | 114 public: |
115 TouchEventCalibrate() : left_(0), right_(0), top_(0), bottom_(0) { | 115 TouchEventCalibrate() : left_(0), right_(0), top_(0), bottom_(0) { |
116 if (ui::PlatformEventSource::GetInstance()) | 116 if (ui::PlatformEventSource::GetInstance()) |
117 ui::PlatformEventSource::GetInstance()->AddPlatformEventObserver(this); | 117 ui::PlatformEventSource::GetInstance()->AddPlatformEventObserver(this); |
118 std::vector<std::string> parts; | 118 std::vector<std::string> parts; |
119 if (Tokenize(CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 119 if (Tokenize(base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
120 switches::kTouchCalibration), | 120 switches::kTouchCalibration), |
121 ",", | 121 ",", &parts) >= 4) { |
122 &parts) >= 4) { | |
123 if (!base::StringToInt(parts[0], &left_)) | 122 if (!base::StringToInt(parts[0], &left_)) |
124 DLOG(ERROR) << "Incorrect left border calibration value passed."; | 123 DLOG(ERROR) << "Incorrect left border calibration value passed."; |
125 if (!base::StringToInt(parts[1], &right_)) | 124 if (!base::StringToInt(parts[1], &right_)) |
126 DLOG(ERROR) << "Incorrect right border calibration value passed."; | 125 DLOG(ERROR) << "Incorrect right border calibration value passed."; |
127 if (!base::StringToInt(parts[2], &top_)) | 126 if (!base::StringToInt(parts[2], &top_)) |
128 DLOG(ERROR) << "Incorrect top border calibration value passed."; | 127 DLOG(ERROR) << "Incorrect top border calibration value passed."; |
129 if (!base::StringToInt(parts[3], &bottom_)) | 128 if (!base::StringToInt(parts[3], &bottom_)) |
130 DLOG(ERROR) << "Incorrect bottom border calibration value passed."; | 129 DLOG(ERROR) << "Incorrect bottom border calibration value passed."; |
131 } | 130 } |
132 } | 131 } |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 } | 686 } |
688 | 687 |
689 namespace test { | 688 namespace test { |
690 | 689 |
691 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { | 690 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { |
692 default_override_redirect = override_redirect; | 691 default_override_redirect = override_redirect; |
693 } | 692 } |
694 | 693 |
695 } // namespace test | 694 } // namespace test |
696 } // namespace aura | 695 } // namespace aura |
OLD | NEW |