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

Side by Side Diff: chrome/browser/chromeos/device/input_service_proxy.h

Issue 913773002: Created fakes for HID-detection screen testing. Initial browsertest added. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 #ifndef CHROME_BROWSER_CHROMEOS_DEVICE_INPUT_SERVICE_PROXY_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_DEVICE_INPUT_SERVICE_PROXY_H_
6 #define CHROME_BROWSER_CHROMEOS_DEVICE_INPUT_SERVICE_PROXY_H_ 6 #define CHROME_BROWSER_CHROMEOS_DEVICE_INPUT_SERVICE_PROXY_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 17 matching lines...) Expand all
28 virtual void OnInputDeviceAdded(const InputDeviceInfo& info) = 0; 28 virtual void OnInputDeviceAdded(const InputDeviceInfo& info) = 0;
29 virtual void OnInputDeviceRemoved(const std::string& id) = 0; 29 virtual void OnInputDeviceRemoved(const std::string& id) = 0;
30 }; 30 };
31 31
32 typedef base::Callback<void(const std::vector<InputDeviceInfo>& devices)> 32 typedef base::Callback<void(const std::vector<InputDeviceInfo>& devices)>
33 GetDevicesCallback; 33 GetDevicesCallback;
34 typedef base::Callback<void(bool success, const InputDeviceInfo& info)> 34 typedef base::Callback<void(bool success, const InputDeviceInfo& info)>
35 GetDeviceInfoCallback; 35 GetDeviceInfoCallback;
36 36
37 InputServiceProxy(); 37 InputServiceProxy();
38 ~InputServiceProxy(); 38 virtual ~InputServiceProxy();
39 39
40 // Used for early init for cashing info about available HID. 40 // Used for early init for cashing info about available HID.
41 static void WarmUp(); 41 static void WarmUp();
42 42
43 void AddObserver(Observer* observer); 43 void AddObserver(Observer* observer);
44 void RemoveObserver(Observer* observer); 44 void RemoveObserver(Observer* observer);
45 45
46 void GetDevices(const GetDevicesCallback& callback); 46 virtual void GetDevices(const GetDevicesCallback& callback);
47 void GetDeviceInfo(const std::string& id, 47 virtual void GetDeviceInfo(const std::string& id,
48 const GetDeviceInfoCallback& callback); 48 const GetDeviceInfoCallback& callback);
49
50 protected:
51 ObserverList<Observer> observers_;
49 52
50 private: 53 private:
51 class ServiceObserver; 54 class ServiceObserver;
52 55
53 void OnDeviceAdded(const device::InputServiceLinux::InputDeviceInfo& info); 56 virtual void OnDeviceAdded(
54 void OnDeviceRemoved(const std::string& id); 57 const device::InputServiceLinux::InputDeviceInfo& info);
58 virtual void OnDeviceRemoved(const std::string& id);
55 59
56 ObserverList<Observer> observers_;
57 scoped_ptr<ServiceObserver> service_observer_; 60 scoped_ptr<ServiceObserver> service_observer_;
58 61
59 base::ThreadChecker thread_checker_; 62 base::ThreadChecker thread_checker_;
60 63
61 base::WeakPtrFactory<InputServiceProxy> weak_factory_; 64 base::WeakPtrFactory<InputServiceProxy> weak_factory_;
62 65
63 DISALLOW_COPY_AND_ASSIGN(InputServiceProxy); 66 DISALLOW_COPY_AND_ASSIGN(InputServiceProxy);
64 }; 67 };
65 68
66 } // namespace chromeos 69 } // namespace chromeos
67 70
68 #endif // CHROME_BROWSER_CHROMEOS_DEVICE_INPUT_SERVICE_PROXY_H_ 71 #endif // CHROME_BROWSER_CHROMEOS_DEVICE_INPUT_SERVICE_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698