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

Side by Side Diff: content/browser/bluetooth/first_device_bluetooth_chooser.cc

Issue 1286063002: Add a path for content/ to open and control a Bluetooth chooser dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Clean up. 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 #include "content/browser/bluetooth/first_device_bluetooth_chooser.h"
6
7 namespace content {
8
9 void FirstDeviceBluetoothChooser::SetAdapterPresence(AdapterPresence presence) {
10 switch (presence) {
11 case AdapterPresence::ABSENT:
12 case AdapterPresence::POWERED_OFF:
13 // Without a user-visible dialog, if the adapter is off, there's no way to
14 // ask the user to turn it on again, so we should cancel.
15 CallDialogCancelled();
16 break;
17 case AdapterPresence::POWERED_ON:
18 break;
19 }
20 }
21
22 void FirstDeviceBluetoothChooser::ShowDiscovering(DiscoveryState state) {
23 switch (state) {
24 case DiscoveryState::FAILED_TO_START:
25 case DiscoveryState::IDLE:
26 // Without a user-visible dialog, if discovery finishes without finding a
27 // device, we'll never find one, so we should cancel.
28 CallDialogCancelled();
29 break;
30 case DiscoveryState::DISCOVERING:
31 break;
32 }
33 }
34
35 void FirstDeviceBluetoothChooser::AddDevice(const std::string& deviceId,
36 const base::string16& deviceName) {
37 CallDeviceSelected(deviceId);
38 }
39
40 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698