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

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: . Created 6 years, 7 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/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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 } 435 }
436 break; 436 break;
437 } 437 }
438 case MappingNotify: { 438 case MappingNotify: {
439 switch (xev->xmapping.request) { 439 switch (xev->xmapping.request) {
440 case MappingModifier: 440 case MappingModifier:
441 case MappingKeyboard: 441 case MappingKeyboard:
442 XRefreshKeyboardMapping(&xev->xmapping); 442 XRefreshKeyboardMapping(&xev->xmapping);
443 break; 443 break;
444 case MappingPointer: 444 case MappingPointer:
445 ui::DeviceDataManager::GetInstance()->UpdateButtonMap(); 445 ui::DeviceDataManagerX11::GetInstance()->UpdateButtonMap();
446 break; 446 break;
447 default: 447 default:
448 NOTIMPLEMENTED() << " Unknown request: " << xev->xmapping.request; 448 NOTIMPLEMENTED() << " Unknown request: " << xev->xmapping.request;
449 break; 449 break;
450 } 450 }
451 break; 451 break;
452 } 452 }
453 case MotionNotify: { 453 case MotionNotify: {
454 // Discard all but the most recent motion event that targets the same 454 // Discard all but the most recent motion event that targets the same
455 // window with unchanged state. 455 // window with unchanged state.
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 ui::EventType type = ui::EventTypeFromNative(xev); 644 ui::EventType type = ui::EventTypeFromNative(xev);
645 XEvent last_event; 645 XEvent last_event;
646 int num_coalesced = 0; 646 int num_coalesced = 0;
647 647
648 switch (type) { 648 switch (type) {
649 case ui::ET_TOUCH_MOVED: 649 case ui::ET_TOUCH_MOVED:
650 case ui::ET_TOUCH_PRESSED: 650 case ui::ET_TOUCH_PRESSED:
651 case ui::ET_TOUCH_CANCELLED: 651 case ui::ET_TOUCH_CANCELLED:
652 case ui::ET_TOUCH_RELEASED: { 652 case ui::ET_TOUCH_RELEASED: {
653 ui::TouchEvent touchev(xev); 653 ui::TouchEvent touchev(xev);
654 if (ui::DeviceDataManager::GetInstance()->TouchEventNeedsCalibrate( 654 if (ui::DeviceDataManagerX11::GetInstance()->TouchEventNeedsCalibrate(
655 xiev->deviceid)) { 655 xiev->deviceid)) {
656 touch_calibrate_->Calibrate(&touchev, bounds_); 656 touch_calibrate_->Calibrate(&touchev, bounds_);
657 } 657 }
658 TranslateAndDispatchLocatedEvent(&touchev); 658 TranslateAndDispatchLocatedEvent(&touchev);
659 break; 659 break;
660 } 660 }
661 case ui::ET_MOUSE_MOVED: 661 case ui::ET_MOUSE_MOVED:
662 case ui::ET_MOUSE_DRAGGED: 662 case ui::ET_MOUSE_DRAGGED:
663 case ui::ET_MOUSE_PRESSED: 663 case ui::ET_MOUSE_PRESSED:
664 case ui::ET_MOUSE_RELEASED: 664 case ui::ET_MOUSE_RELEASED:
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 } 723 }
724 724
725 namespace test { 725 namespace test {
726 726
727 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { 727 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) {
728 default_override_redirect = override_redirect; 728 default_override_redirect = override_redirect;
729 } 729 }
730 730
731 } // namespace test 731 } // namespace test
732 } // namespace aura 732 } // namespace aura
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698