| OLD | NEW |
| 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/devices/device_data_manager.h" | 5 #include "ui/events/devices/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/display/types/display_constants.h" | 10 #include "ui/display/types/display_constants.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // static | 74 // static |
| 75 void DeviceDataManager::DeleteInstance() { | 75 void DeviceDataManager::DeleteInstance() { |
| 76 if (instance_) { | 76 if (instance_) { |
| 77 delete instance_; | 77 delete instance_; |
| 78 instance_ = nullptr; | 78 instance_ = nullptr; |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 | 81 |
| 82 // static | 82 // static |
| 83 DeviceDataManager* DeviceDataManager::GetInstance() { | 83 DeviceDataManager* DeviceDataManager::GetInstance() { |
| 84 CHECK(instance_) << "DeviceDataManager was not created."; | 84 // DeviceDataManager was not created. |
| 85 CHECK(instance_); |
| 85 return instance_; | 86 return instance_; |
| 86 } | 87 } |
| 87 | 88 |
| 88 // static | 89 // static |
| 89 bool DeviceDataManager::HasInstance() { | 90 bool DeviceDataManager::HasInstance() { |
| 90 return instance_ != nullptr; | 91 return instance_ != nullptr; |
| 91 } | 92 } |
| 92 | 93 |
| 93 void DeviceDataManager::ClearTouchDeviceAssociations() { | 94 void DeviceDataManager::ClearTouchDeviceAssociations() { |
| 94 for (auto& touch_info : touch_map_) | 95 for (auto& touch_info : touch_map_) |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 | 253 |
| 253 void DeviceDataManager::SetTouchscreensEnabled(bool enabled) { | 254 void DeviceDataManager::SetTouchscreensEnabled(bool enabled) { |
| 254 touch_screens_enabled_ = enabled; | 255 touch_screens_enabled_ = enabled; |
| 255 } | 256 } |
| 256 | 257 |
| 257 bool DeviceDataManager::AreTouchscreensEnabled() const { | 258 bool DeviceDataManager::AreTouchscreensEnabled() const { |
| 258 return touch_screens_enabled_; | 259 return touch_screens_enabled_; |
| 259 } | 260 } |
| 260 | 261 |
| 261 } // namespace ui | 262 } // namespace ui |
| OLD | NEW |