Support permission_broker for chrome.hid devices.

This enables the Chrome to query permission_broker for access
to hidraw device paths when running on Chrome OS.

HidService has been refactored so that it is owned by the
extensions API embedder, rather than being a singleton.

Because hid has just moved to //extensions as well, this also establishes a new ShellExtensionsAPIClient to create a HidService for app_shell.

BUG=367145
TEST=manual test on ChromeOS dev build
[email protected] for mechanical app_shell changes

Review URL: https://codereview.chromium.org/419713002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285774 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/device/hid/hid_service_linux.h b/device/hid/hid_service_linux.h
index c69096d..62bb4c7 100644
--- a/device/hid/hid_service_linux.h
+++ b/device/hid/hid_service_linux.h
@@ -7,6 +7,7 @@
 
 #include "base/compiler_specific.h"
 #include "base/macros.h"
+#include "base/memory/weak_ptr.h"
 #include "device/hid/device_monitor_linux.h"
 #include "device/hid/hid_device_info.h"
 #include "device/hid/hid_service.h"
@@ -20,7 +21,7 @@
 class HidServiceLinux : public HidService,
                         public DeviceMonitorLinux::Observer {
  public:
-  HidServiceLinux();
+  HidServiceLinux(scoped_refptr<base::MessageLoopProxy> ui_message_loop);
 
   virtual scoped_refptr<HidConnection> Connect(const HidDeviceId& device_id)
       OVERRIDE;
@@ -32,6 +33,15 @@
  private:
   virtual ~HidServiceLinux();
 
+  void OnRequestAccessComplete(
+      const std::string& path,
+      scoped_ptr<HidDeviceInfo> device_info,
+      bool success);
+
+  scoped_refptr<base::MessageLoopProxy> ui_message_loop_;
+
+  base::WeakPtrFactory<HidServiceLinux> weak_factory_;
+
   DISALLOW_COPY_AND_ASSIGN(HidServiceLinux);
 };