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

Side by Side Diff: content/browser/bluetooth/bluetooth_device_chooser_controller.h

Issue 2059543002: bluetooth: Move FactoryWrapper to device and expose a function for testing in chooser controller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Fix typo Created 4 years, 6 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DEVICE_CHOOSER_CONTROLLER_H_ 5 #ifndef CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DEVICE_CHOOSER_CONTROLLER_H_
6 #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DEVICE_CHOOSER_CONTROLLER_H_ 6 #define CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DEVICE_CHOOSER_CONTROLLER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 23 matching lines...) Expand all
34 typedef base::Callback<void(blink::mojom::WebBluetoothRequestDeviceOptionsPtr, 34 typedef base::Callback<void(blink::mojom::WebBluetoothRequestDeviceOptionsPtr,
35 const std::string& device_address)> 35 const std::string& device_address)>
36 SuccessCallback; 36 SuccessCallback;
37 typedef base::Callback<void(blink::mojom::WebBluetoothError error)> 37 typedef base::Callback<void(blink::mojom::WebBluetoothError error)>
38 ErrorCallback; 38 ErrorCallback;
39 39
40 // |web_bluetooth_service_| service that owns this class. 40 // |web_bluetooth_service_| service that owns this class.
41 // |render_frame_host| should be the RenderFrameHost that owns the 41 // |render_frame_host| should be the RenderFrameHost that owns the
42 // |web_bluetooth_service_|. 42 // |web_bluetooth_service_|.
43 // |adapter| should be the adapter used to scan for Bluetooth devices. 43 // |adapter| should be the adapter used to scan for Bluetooth devices.
44 // |scan_duration| is how long will a discovery session be active. 44 // |scan_duration| is how long will a discovery session be active.
scheib 2016/06/22 03:44:22 Remove comment for scan duration.
ortuno 2016/06/23 21:54:59 Done.
45 BluetoothDeviceChooserController( 45 BluetoothDeviceChooserController(
46 WebBluetoothServiceImpl* web_bluetooth_service_, 46 WebBluetoothServiceImpl* web_bluetooth_service_,
47 RenderFrameHost* render_frame_host, 47 RenderFrameHost* render_frame_host,
48 device::BluetoothAdapter* adapter, 48 device::BluetoothAdapter* adapter);
49 base::TimeDelta scan_duration);
50 ~BluetoothDeviceChooserController(); 49 ~BluetoothDeviceChooserController();
51 50
52 // This function performs the following checks before starting a discovery 51 // This function performs the following checks before starting a discovery
53 // session: 52 // session:
54 // - Validates filters in |request_device_options|. 53 // - Validates filters in |request_device_options|.
55 // - Removes any blacklisted UUIDs from 54 // - Removes any blacklisted UUIDs from
56 // |request_device_options.optinal_services|. 55 // |request_device_options.optinal_services|.
57 // - Checks if the request came from a cross-origin iframe. 56 // - Checks if the request came from a cross-origin iframe.
58 // - Checks if the request came from a unique origin. 57 // - Checks if the request came from a unique origin.
59 // - Checks if the adapter is present. 58 // - Checks if the adapter is present.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // Weak pointer factory for generating 'this' pointers that might live longer 138 // Weak pointer factory for generating 'this' pointers that might live longer
140 // than we do. 139 // than we do.
141 // Note: This should remain the last member so it'll be destroyed and 140 // Note: This should remain the last member so it'll be destroyed and
142 // invalidate its weak pointers before any other members are destroyed. 141 // invalidate its weak pointers before any other members are destroyed.
143 base::WeakPtrFactory<BluetoothDeviceChooserController> weak_ptr_factory_; 142 base::WeakPtrFactory<BluetoothDeviceChooserController> weak_ptr_factory_;
144 }; 143 };
145 144
146 } // namespace content 145 } // namespace content
147 146
148 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DEVICE_CHOOSER_CONTROLLER_H_ 147 #endif // CONTENT_BROWSER_BLUETOOTH_BLUETOOTH_DEVICE_CHOOSER_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698