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

Unified Diff: device/hid/input_service_linux.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: FakeInputServiceLinux used instead of FakeInputServiceProxy. 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 side-by-side diff with in-line comments
Download patch
Index: device/hid/input_service_linux.h
diff --git a/device/hid/input_service_linux.h b/device/hid/input_service_linux.h
index 55bf70c1c682a1231795bdce2173c7c28d7bc147..02e7570cc890efd586f11350bdaae8e419930119 100644
--- a/device/hid/input_service_linux.h
+++ b/device/hid/input_service_linux.h
@@ -14,7 +14,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/observer_list.h"
-#include "base/threading/thread_checker.h"
+
#include "device/hid/device_monitor_linux.h"
namespace device {
@@ -45,6 +45,8 @@ class InputServiceLinux : public base::MessageLoop::DestructionObserver {
bool is_touchscreen : 1;
};
+ typedef base::hash_map<std::string, InputDeviceInfo> DeviceMap;
+
class Observer {
public:
virtual ~Observer() {}
@@ -53,42 +55,36 @@ class InputServiceLinux : public base::MessageLoop::DestructionObserver {
};
InputServiceLinux();
+ ~InputServiceLinux() override;
static InputServiceLinux* GetInstance();
static bool HasInstance();
static void SetForTesting(InputServiceLinux* service);
- void AddObserver(Observer* observer);
- void RemoveObserver(Observer* observer);
+ virtual void AddObserver(Observer* observer);
+ virtual void RemoveObserver(Observer* observer);
// Returns list of all currently connected input/hid devices.
- void GetDevices(std::vector<InputDeviceInfo>* devices);
+ virtual void GetDevices(std::vector<InputDeviceInfo>* devices);
// Returns an info about input device identified by |id|. When there're
// no input or hid device with such id, returns false and doesn't
// modify |info|.
- bool GetDeviceInfo(const std::string& id, InputDeviceInfo* info) const;
+ virtual bool GetDeviceInfo(
+ const std::string& id, InputDeviceInfo* info) const;
// Implements base::MessageLoop::DestructionObserver
void WillDestroyCurrentMessageLoop() override;
protected:
- ~InputServiceLinux() override;
-
- void AddDevice(const InputDeviceInfo& info);
- void RemoveDevice(const std::string& id);
-
- bool CalledOnValidThread() const;
-
- private:
- friend struct base::DefaultDeleter<InputServiceLinux>;
-
- typedef base::hash_map<std::string, InputDeviceInfo> DeviceMap;
+ virtual void AddDevice(const InputDeviceInfo& info);
+ virtual void RemoveDevice(const std::string& id);
DeviceMap devices_;
Nikita (slow) 2015/02/13 12:31:45 nit: add empty line between methods and members.
merkulova 2015/02/13 12:58:06 Done.
ObserverList<Observer> observers_;
- base::ThreadChecker thread_checker_;
+ private:
+ friend struct base::DefaultDeleter<InputServiceLinux>;
DISALLOW_COPY_AND_ASSIGN(InputServiceLinux);
};
« device/hid/hid.gyp ('K') | « device/hid/hid.gyp ('k') | device/hid/input_service_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698