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

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

Issue 23904025: Move IsRunningOnChromeOS to SysInfo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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 | Annotate | Revision Log
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/root_window_host_x11.h" 5 #include "ui/aura/root_window_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/Xfixes.h> 9 #include <X11/extensions/Xfixes.h>
10 #include <X11/extensions/XInput2.h> 10 #include <X11/extensions/XInput2.h>
11 #include <X11/extensions/Xrandr.h> 11 #include <X11/extensions/Xrandr.h>
12 #include <X11/Xatom.h> 12 #include <X11/Xatom.h>
13 #include <X11/Xcursor/Xcursor.h> 13 #include <X11/Xcursor/Xcursor.h>
14 #include <X11/Xlib.h> 14 #include <X11/Xlib.h>
15 15
16 #include <algorithm> 16 #include <algorithm>
17 #include <limits> 17 #include <limits>
18 #include <string> 18 #include <string>
19 19
20 #include "base/command_line.h" 20 #include "base/command_line.h"
21 #include "base/debug/trace_event.h" 21 #include "base/debug/trace_event.h"
22 #include "base/message_loop/message_loop.h" 22 #include "base/message_loop/message_loop.h"
23 #include "base/message_loop/message_pump_x11.h" 23 #include "base/message_loop/message_pump_x11.h"
24 #include "base/stl_util.h" 24 #include "base/stl_util.h"
25 #include "base/strings/string_number_conversions.h" 25 #include "base/strings/string_number_conversions.h"
26 #include "base/strings/string_util.h" 26 #include "base/strings/string_util.h"
27 #include "base/strings/stringprintf.h" 27 #include "base/strings/stringprintf.h"
28 #include "base/sys_info.h"
28 #include "ui/aura/client/capture_client.h" 29 #include "ui/aura/client/capture_client.h"
29 #include "ui/aura/client/cursor_client.h" 30 #include "ui/aura/client/cursor_client.h"
30 #include "ui/aura/client/screen_position_client.h" 31 #include "ui/aura/client/screen_position_client.h"
31 #include "ui/aura/client/user_action_client.h" 32 #include "ui/aura/client/user_action_client.h"
32 #include "ui/aura/env.h" 33 #include "ui/aura/env.h"
33 #include "ui/aura/root_window.h" 34 #include "ui/aura/root_window.h"
34 #include "ui/base/cursor/cursor.h" 35 #include "ui/base/cursor/cursor.h"
35 #include "ui/base/touch/touch_factory_x11.h" 36 #include "ui/base/touch/touch_factory_x11.h"
36 #include "ui/base/ui_base_switches.h" 37 #include "ui/base/ui_base_switches.h"
37 #include "ui/base/view_prop.h" 38 #include "ui/base/view_prop.h"
38 #include "ui/base/x/device_list_cache_x.h" 39 #include "ui/base/x/device_list_cache_x.h"
39 #include "ui/base/x/x11_util.h" 40 #include "ui/base/x/x11_util.h"
40 #include "ui/compositor/dip_util.h" 41 #include "ui/compositor/dip_util.h"
41 #include "ui/compositor/layer.h" 42 #include "ui/compositor/layer.h"
42 #include "ui/events/event.h" 43 #include "ui/events/event.h"
43 #include "ui/events/event_utils.h" 44 #include "ui/events/event_utils.h"
44 #include "ui/events/keycodes/keyboard_codes.h" 45 #include "ui/events/keycodes/keyboard_codes.h"
45 #include "ui/gfx/screen.h" 46 #include "ui/gfx/screen.h"
46 47
47 #if defined(OS_CHROMEOS)
48 #include "base/chromeos/chromeos_version.h"
49 #endif
50
51 using std::max; 48 using std::max;
52 using std::min; 49 using std::min;
53 50
54 namespace aura { 51 namespace aura {
55 52
56 namespace { 53 namespace {
57 54
58 // Standard Linux mouse buttons for going back and forward. 55 // Standard Linux mouse buttons for going back and forward.
59 const int kBackMouseButton = 8; 56 const int kBackMouseButton = 8;
60 const int kForwardMouseButton = 9; 57 const int kForwardMouseButton = 9;
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 bezel_tracking_ids_ |= tracking_id; 920 bezel_tracking_ids_ |= tracking_id;
924 if (bezel_tracking_ids_ & tracking_id) { 921 if (bezel_tracking_ids_ & tracking_id) {
925 if (type == ui::ET_TOUCH_CANCELLED || type == ui::ET_TOUCH_RELEASED) 922 if (type == ui::ET_TOUCH_CANCELLED || type == ui::ET_TOUCH_RELEASED)
926 bezel_tracking_ids_ = 923 bezel_tracking_ids_ =
927 (bezel_tracking_ids_ | tracking_id) ^ tracking_id; 924 (bezel_tracking_ids_ | tracking_id) ^ tracking_id;
928 return; 925 return;
929 } 926 }
930 } 927 }
931 #endif // defined(USE_XI2_MT) 928 #endif // defined(USE_XI2_MT)
932 #if defined(OS_CHROMEOS) 929 #if defined(OS_CHROMEOS)
933 if (base::chromeos::IsRunningOnChromeOS()) { 930 if (base::SysInfo::IsRunningOnChromeOS()) {
934 if (!bounds_.Contains(touchev.location())) 931 if (!bounds_.Contains(touchev.location()))
935 break; 932 break;
936 // X maps the touch-surface to the size of the X root-window. 933 // X maps the touch-surface to the size of the X root-window.
937 // In multi-monitor setup, Coordinate Transformation Matrix 934 // In multi-monitor setup, Coordinate Transformation Matrix
938 // repositions the touch-surface onto part of X root-window 935 // repositions the touch-surface onto part of X root-window
939 // containing aura root-window corresponding to the touchscreen. 936 // containing aura root-window corresponding to the touchscreen.
940 // However, if aura root-window has non-zero origin, 937 // However, if aura root-window has non-zero origin,
941 // we need to relocate the event into aura root-window coordinates. 938 // we need to relocate the event into aura root-window coordinates.
942 touchev.Relocate(bounds_.origin()); 939 touchev.Relocate(bounds_.origin());
943 #if defined(USE_XI2_MT) 940 #if defined(USE_XI2_MT)
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1095 } 1092 }
1096 1093
1097 namespace test { 1094 namespace test {
1098 1095
1099 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { 1096 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) {
1100 default_override_redirect = override_redirect; 1097 default_override_redirect = override_redirect;
1101 } 1098 }
1102 1099
1103 } // namespace test 1100 } // namespace test
1104 } // namespace aura 1101 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698