OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ui/webui/settings/chromeos/device_pointer_handler.h" | 5 #include "chrome/browser/ui/webui/settings/chromeos/device_pointer_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "content/public/browser/web_ui.h" | 9 #include "content/public/browser/web_ui.h" |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 pointer_device_observer_->AddObserver(this); | 30 pointer_device_observer_->AddObserver(this); |
31 pointer_device_observer_->CheckDevices(); | 31 pointer_device_observer_->CheckDevices(); |
32 } | 32 } |
33 | 33 |
34 void PointerHandler::OnJavascriptDisallowed() { | 34 void PointerHandler::OnJavascriptDisallowed() { |
35 pointer_device_observer_->RemoveObserver(this); | 35 pointer_device_observer_->RemoveObserver(this); |
36 } | 36 } |
37 | 37 |
38 void PointerHandler::TouchpadExists(bool exists) { | 38 void PointerHandler::TouchpadExists(bool exists) { |
39 CallJavascriptFunction("cr.webUIListenerCallback", | 39 CallJavascriptFunction("cr.webUIListenerCallback", |
40 base::StringValue("has-touchpad-changed"), | 40 base::Value("has-touchpad-changed"), |
41 base::Value(exists)); | 41 base::Value(exists)); |
42 } | 42 } |
43 | 43 |
44 void PointerHandler::MouseExists(bool exists) { | 44 void PointerHandler::MouseExists(bool exists) { |
45 CallJavascriptFunction("cr.webUIListenerCallback", | 45 CallJavascriptFunction("cr.webUIListenerCallback", |
46 base::StringValue("has-mouse-changed"), | 46 base::Value("has-mouse-changed"), base::Value(exists)); |
47 base::Value(exists)); | |
48 } | 47 } |
49 | 48 |
50 void PointerHandler::HandleInitialize(const base::ListValue* args) { | 49 void PointerHandler::HandleInitialize(const base::ListValue* args) { |
51 AllowJavascript(); | 50 AllowJavascript(); |
52 } | 51 } |
53 | 52 |
54 } // namespace settings | 53 } // namespace settings |
55 } // namespace chromeos | 54 } // namespace chromeos |
OLD | NEW |