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

Side by Side Diff: ui/events/device_data_manager.cc

Issue 313913004: Block internal PlatformEvents before they are dispatched in touchview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix updating cursor on enter notify. Created 6 years, 5 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 | « ui/events/device_data_manager.h ('k') | ui/events/x/device_data_manager_x11.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/events/device_data_manager.h" 5 #include "ui/events/device_data_manager.h"
6 6
7 #include "base/at_exit.h" 7 #include "base/at_exit.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/gfx/display.h" 10 #include "ui/gfx/display.h"
(...skipping 30 matching lines...) Expand all
41 41
42 new DeviceDataManager(); 42 new DeviceDataManager();
43 } 43 }
44 44
45 // static 45 // static
46 DeviceDataManager* DeviceDataManager::GetInstance() { 46 DeviceDataManager* DeviceDataManager::GetInstance() {
47 CHECK(instance_) << "DeviceDataManager was not created."; 47 CHECK(instance_) << "DeviceDataManager was not created.";
48 return instance_; 48 return instance_;
49 } 49 }
50 50
51 // static
52 bool DeviceDataManager::HasInstance() {
53 return instance_ != NULL;
54 }
55
51 void DeviceDataManager::ClearTouchTransformerRecord() { 56 void DeviceDataManager::ClearTouchTransformerRecord() {
52 for (int i = 0; i < kMaxDeviceNum; i++) { 57 for (int i = 0; i < kMaxDeviceNum; i++) {
53 touch_device_transformer_map_[i] = gfx::Transform(); 58 touch_device_transformer_map_[i] = gfx::Transform();
54 touch_device_to_display_map_[i] = gfx::Display::kInvalidDisplayID; 59 touch_device_to_display_map_[i] = gfx::Display::kInvalidDisplayID;
55 } 60 }
56 } 61 }
57 62
58 bool DeviceDataManager::IsTouchDeviceIdValid(int touch_device_id) const { 63 bool DeviceDataManager::IsTouchDeviceIdValid(int touch_device_id) const {
59 return (touch_device_id > 0 && touch_device_id < kMaxDeviceNum); 64 return (touch_device_id > 0 && touch_device_id < kMaxDeviceNum);
60 } 65 }
(...skipping 21 matching lines...) Expand all
82 } 87 }
83 } 88 }
84 89
85 int64_t DeviceDataManager::GetDisplayForTouchDevice(int touch_device_id) const { 90 int64_t DeviceDataManager::GetDisplayForTouchDevice(int touch_device_id) const {
86 if (IsTouchDeviceIdValid(touch_device_id)) 91 if (IsTouchDeviceIdValid(touch_device_id))
87 return touch_device_to_display_map_[touch_device_id]; 92 return touch_device_to_display_map_[touch_device_id];
88 return gfx::Display::kInvalidDisplayID; 93 return gfx::Display::kInvalidDisplayID;
89 } 94 }
90 95
91 } // namespace ui 96 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/device_data_manager.h ('k') | ui/events/x/device_data_manager_x11.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698