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

Side by Side Diff: components/webusb/webusb_browser_client.h

Issue 1289423002: Add webusb notification UI code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: added some #ifdef flags Created 5 years, 4 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_WEBUSB_WEBUSB_BROWSER_CLIENT_H_
6 #define COMPONENTS_WEBUSB_WEBUSB_BROWSER_CLIENT_H_
7
8 #include <string>
9
10 #include "base/memory/weak_ptr.h"
11 #include "base/scoped_observer.h"
12 #include "components/keyed_service/core/keyed_service.h"
13 #include "device/usb/usb_service.h"
14
15 class GURL;
16 class Profile;
17
18 namespace webusb {
19
20 // Interface to allow the webusb module to make browser-process-specific
21 // calls. Should be Set() once in the browser process.
22
23 class WebUsbBrowserClient {
24 public:
25 virtual ~WebUsbBrowserClient() {}
26
27 virtual void OnDeviceAdded(Profile* profile,
28 const char* product_name,
29 const GURL& landing_page,
30 const std::string& notification_id) = 0;
31
32 virtual void OnDeviceRemoved(const std::string& notification_id) = 0;
33
34 virtual void OpenURL(Profile* profile, const GURL& url) = 0;
35
36 virtual bool WebUsbNotificationEnabled() = 0;
37
38 // Returns the single instance of |this|.
39 static WebUsbBrowserClient* Get();
40
41 // Initialize the single instance.
42 static void Set(WebUsbBrowserClient* client);
43 };
44
45 } // namespace webusb
46
47 #endif // COMPONENTS_WEBUSB_WEBUSB_BROWSER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698