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

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

Powered by Google App Engine
This is Rietveld 408576698