Index: components/webusb/webusb_browser_client.h |
diff --git a/components/webusb/webusb_browser_client.h b/components/webusb/webusb_browser_client.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..327aed2b2db52c0146f9df458a991a9e6a40394a |
--- /dev/null |
+++ b/components/webusb/webusb_browser_client.h |
@@ -0,0 +1,39 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef COMPONENTS_WEBUSB_WEBUSB_BROWSER_CLIENT_H_ |
+#define COMPONENTS_WEBUSB_WEBUSB_BROWSER_CLIENT_H_ |
+ |
+#include <string> |
+ |
+#include "base/macros.h" |
+#include "base/strings/string16.h" |
+ |
+class GURL; |
+ |
+namespace webusb { |
+ |
+// Interface to allow the webusb module to make browser-process-specific |
+// calls. Should be Set() once in the browser process. |
+ |
+class WebUsbBrowserClient { |
+ public: |
+ virtual ~WebUsbBrowserClient() {} |
+ |
+ virtual void OnDeviceAdded(const base::string16& product_name, |
+ const GURL& landing_page, |
+ const std::string& notification_id) = 0; |
+ |
+ virtual void OnDeviceRemoved(const std::string& notification_id) = 0; |
+ |
+ // Returns the single instance of |this|. |
+ static WebUsbBrowserClient* Get(); |
+ |
+ // Initialize the single instance. |
+ static void Set(WebUsbBrowserClient* client); |
+}; |
+ |
+} // namespace webusb |
+ |
+#endif // COMPONENTS_WEBUSB_WEBUSB_BROWSER_CLIENT_H_ |