OLD | NEW |
---|---|
(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 #include "components/webusb/webusb_browser_client.h" | |
6 | |
7 namespace webusb { | |
8 | |
9 namespace { | |
10 | |
11 WebUsbBrowserClient* webusb_browser_client = nullptr; | |
12 | |
13 } // namespace | |
14 | |
15 WebUsbBrowserClient* WebUsbBrowserClient::Get() { | |
16 if (!webusb_browser_client || | |
17 !webusb_browser_client->WebUsbNotificationEnabled()) { | |
Reilly Grant (use Gerrit)
2015/08/20 17:02:45
This feels weird. Why not just not Set() the brows
juncai
2015/08/21 05:16:04
Done.
| |
18 return nullptr; | |
19 } | |
20 return webusb_browser_client; | |
21 } | |
22 | |
23 void WebUsbBrowserClient::Set(WebUsbBrowserClient* client) { | |
24 webusb_browser_client = client; | |
25 } | |
26 | |
27 } // namespace webusb | |
OLD | NEW |