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

Side by Side Diff: chrome/browser/chromeos/system/input_device_settings_impl_ozone.cc

Issue 1049873005: [chrome/browser/chromeos/] favor DCHECK_CURRENTLY_ON for better logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
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 "chrome/browser/chromeos/system/input_device_settings.h" 5 #include "chrome/browser/chromeos/system/input_device_settings.h"
6 6
7 #include "content/public/browser/browser_thread.h" 7 #include "content/public/browser/browser_thread.h"
8 #include "ui/ozone/public/input_controller.h" 8 #include "ui/ozone/public/input_controller.h"
9 #include "ui/ozone/public/ozone_platform.h" 9 #include "ui/ozone/public/ozone_platform.h"
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 InputDeviceSettingsImplOzone::InputDeviceSettingsImplOzone() 54 InputDeviceSettingsImplOzone::InputDeviceSettingsImplOzone()
55 : input_controller_( 55 : input_controller_(
56 ui::OzonePlatform::GetInstance()->GetInputController()) { 56 ui::OzonePlatform::GetInstance()->GetInputController()) {
57 // Make sure the input controller does exist. 57 // Make sure the input controller does exist.
58 DCHECK(ui::OzonePlatform::GetInstance()->GetInputController()); 58 DCHECK(ui::OzonePlatform::GetInstance()->GetInputController());
59 } 59 }
60 60
61 void InputDeviceSettingsImplOzone::TouchpadExists( 61 void InputDeviceSettingsImplOzone::TouchpadExists(
62 const DeviceExistsCallback& callback) { 62 const DeviceExistsCallback& callback) {
63 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 63 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
64 callback.Run(input_controller_->HasTouchpad()); 64 callback.Run(input_controller_->HasTouchpad());
65 } 65 }
66 66
67 void InputDeviceSettingsImplOzone::UpdateTouchpadSettings( 67 void InputDeviceSettingsImplOzone::UpdateTouchpadSettings(
68 const TouchpadSettings& settings) { 68 const TouchpadSettings& settings) {
69 if (current_touchpad_settings_.Update(settings)) 69 if (current_touchpad_settings_.Update(settings))
70 ReapplyTouchpadSettings(); 70 ReapplyTouchpadSettings();
71 } 71 }
72 72
73 void InputDeviceSettingsImplOzone::SetTouchpadSensitivity(int value) { 73 void InputDeviceSettingsImplOzone::SetTouchpadSensitivity(int value) {
(...skipping 18 matching lines...) Expand all
92 input_controller_->SetThreeFingerClick(enabled); 92 input_controller_->SetThreeFingerClick(enabled);
93 } 93 }
94 94
95 void InputDeviceSettingsImplOzone::SetTapDragging(bool enabled) { 95 void InputDeviceSettingsImplOzone::SetTapDragging(bool enabled) {
96 current_touchpad_settings_.SetTapDragging(enabled); 96 current_touchpad_settings_.SetTapDragging(enabled);
97 input_controller_->SetTapDragging(enabled); 97 input_controller_->SetTapDragging(enabled);
98 } 98 }
99 99
100 void InputDeviceSettingsImplOzone::MouseExists( 100 void InputDeviceSettingsImplOzone::MouseExists(
101 const DeviceExistsCallback& callback) { 101 const DeviceExistsCallback& callback) {
102 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 102 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
103 callback.Run(input_controller_->HasMouse()); 103 callback.Run(input_controller_->HasMouse());
104 } 104 }
105 105
106 void InputDeviceSettingsImplOzone::UpdateMouseSettings( 106 void InputDeviceSettingsImplOzone::UpdateMouseSettings(
107 const MouseSettings& update) { 107 const MouseSettings& update) {
108 if (current_mouse_settings_.Update(update)) 108 if (current_mouse_settings_.Update(update))
109 ReapplyMouseSettings(); 109 ReapplyMouseSettings();
110 } 110 }
111 111
112 void InputDeviceSettingsImplOzone::SetMouseSensitivity(int value) { 112 void InputDeviceSettingsImplOzone::SetMouseSensitivity(int value) {
(...skipping 30 matching lines...) Expand all
143 void InputDeviceSettings::SetSettingsForTesting( 143 void InputDeviceSettings::SetSettingsForTesting(
144 InputDeviceSettings* test_settings) { 144 InputDeviceSettings* test_settings) {
145 if (g_test_instance == test_settings) 145 if (g_test_instance == test_settings)
146 return; 146 return;
147 delete g_test_instance; 147 delete g_test_instance;
148 g_test_instance = test_settings; 148 g_test_instance = test_settings;
149 } 149 }
150 150
151 } // namespace system 151 } // namespace system
152 } // namespace chromeos 152 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698