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

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

Issue 289283015: Extract touchscreen device management into a generic manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 years, 6 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 | « chrome/browser/metrics/chromeos_metrics_provider_unittest.cc ('k') | ui/base/x/x11_util.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 23 matching lines...) Expand all
34 #include "ui/base/x/x11_util.h" 34 #include "ui/base/x/x11_util.h"
35 #include "ui/compositor/compositor.h" 35 #include "ui/compositor/compositor.h"
36 #include "ui/compositor/dip_util.h" 36 #include "ui/compositor/dip_util.h"
37 #include "ui/compositor/layer.h" 37 #include "ui/compositor/layer.h"
38 #include "ui/events/event.h" 38 #include "ui/events/event.h"
39 #include "ui/events/event_switches.h" 39 #include "ui/events/event_switches.h"
40 #include "ui/events/event_utils.h" 40 #include "ui/events/event_utils.h"
41 #include "ui/events/keycodes/keyboard_codes.h" 41 #include "ui/events/keycodes/keyboard_codes.h"
42 #include "ui/events/platform/platform_event_observer.h" 42 #include "ui/events/platform/platform_event_observer.h"
43 #include "ui/events/platform/x11/x11_event_source.h" 43 #include "ui/events/platform/x11/x11_event_source.h"
44 #include "ui/events/x/device_data_manager.h" 44 #include "ui/events/x/device_data_manager_x11.h"
45 #include "ui/events/x/device_list_cache_x.h" 45 #include "ui/events/x/device_list_cache_x.h"
46 #include "ui/events/x/touch_factory_x11.h" 46 #include "ui/events/x/touch_factory_x11.h"
47 #include "ui/gfx/screen.h" 47 #include "ui/gfx/screen.h"
48 48
49 using std::max; 49 using std::max;
50 using std::min; 50 using std::min;
51 51
52 namespace aura { 52 namespace aura {
53 53
54 namespace { 54 namespace {
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 } 447 }
448 break; 448 break;
449 } 449 }
450 case MappingNotify: { 450 case MappingNotify: {
451 switch (xev->xmapping.request) { 451 switch (xev->xmapping.request) {
452 case MappingModifier: 452 case MappingModifier:
453 case MappingKeyboard: 453 case MappingKeyboard:
454 XRefreshKeyboardMapping(&xev->xmapping); 454 XRefreshKeyboardMapping(&xev->xmapping);
455 break; 455 break;
456 case MappingPointer: 456 case MappingPointer:
457 ui::DeviceDataManager::GetInstance()->UpdateButtonMap(); 457 ui::DeviceDataManagerX11::GetInstance()->UpdateButtonMap();
458 break; 458 break;
459 default: 459 default:
460 NOTIMPLEMENTED() << " Unknown request: " << xev->xmapping.request; 460 NOTIMPLEMENTED() << " Unknown request: " << xev->xmapping.request;
461 break; 461 break;
462 } 462 }
463 break; 463 break;
464 } 464 }
465 case MotionNotify: { 465 case MotionNotify: {
466 // Discard all but the most recent motion event that targets the same 466 // Discard all but the most recent motion event that targets the same
467 // window with unchanged state. 467 // window with unchanged state.
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 ui::EventType type = ui::EventTypeFromNative(xev); 656 ui::EventType type = ui::EventTypeFromNative(xev);
657 XEvent last_event; 657 XEvent last_event;
658 int num_coalesced = 0; 658 int num_coalesced = 0;
659 659
660 switch (type) { 660 switch (type) {
661 case ui::ET_TOUCH_MOVED: 661 case ui::ET_TOUCH_MOVED:
662 case ui::ET_TOUCH_PRESSED: 662 case ui::ET_TOUCH_PRESSED:
663 case ui::ET_TOUCH_CANCELLED: 663 case ui::ET_TOUCH_CANCELLED:
664 case ui::ET_TOUCH_RELEASED: { 664 case ui::ET_TOUCH_RELEASED: {
665 ui::TouchEvent touchev(xev); 665 ui::TouchEvent touchev(xev);
666 if (ui::DeviceDataManager::GetInstance()->TouchEventNeedsCalibrate( 666 if (ui::DeviceDataManagerX11::GetInstance()->TouchEventNeedsCalibrate(
667 xiev->deviceid)) { 667 xiev->deviceid)) {
668 touch_calibrate_->Calibrate(&touchev, bounds_); 668 touch_calibrate_->Calibrate(&touchev, bounds_);
669 } 669 }
670 TranslateAndDispatchLocatedEvent(&touchev); 670 TranslateAndDispatchLocatedEvent(&touchev);
671 break; 671 break;
672 } 672 }
673 case ui::ET_MOUSE_MOVED: 673 case ui::ET_MOUSE_MOVED:
674 case ui::ET_MOUSE_DRAGGED: 674 case ui::ET_MOUSE_DRAGGED:
675 case ui::ET_MOUSE_PRESSED: 675 case ui::ET_MOUSE_PRESSED:
676 case ui::ET_MOUSE_RELEASED: 676 case ui::ET_MOUSE_RELEASED:
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 } 735 }
736 736
737 namespace test { 737 namespace test {
738 738
739 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { 739 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) {
740 default_override_redirect = override_redirect; 740 default_override_redirect = override_redirect;
741 } 741 }
742 742
743 } // namespace test 743 } // namespace test
744 } // namespace aura 744 } // namespace aura
OLDNEW
« no previous file with comments | « chrome/browser/metrics/chromeos_metrics_provider_unittest.cc ('k') | ui/base/x/x11_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698