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.
5 #ifndef CHROME_BROWSER_UI_ANDROID_BLUETOOTH_CHOOSER_ANDROID_H_
6 #define CHROME_BROWSER_UI_ANDROID_BLUETOOTH_CHOOSER_ANDROID_H_
8 #include "base/android/scoped_java_ref.h"
9 #include "content/public/browser/bluetooth_chooser.h"
10 #include "content/public/browser/web_contents.h"
12 // Represents a way to ask the user to select a Bluetooth device from a list of
14 class BluetoothChooserAndroid
: public content::BluetoothChooser
{
16 BluetoothChooserAndroid(content::WebContents
* web_contents
,
17 const EventHandler
& event_handler
,
19 ~BluetoothChooserAndroid() override
;
21 // content::BluetoothChooser:
22 void SetAdapterPresence(AdapterPresence presence
) override
;
23 void ShowDiscoveryState(DiscoveryState state
) override
;
24 void AddDevice(const std::string
& device_id
,
25 const base::string16
& device_name
) override
;
26 void RemoveDevice(const std::string
& device_id
) override
;
28 // Report which device was selected (device_id).
29 void OnDeviceSelected(JNIEnv
* env
, jobject obj
, jstring device_id
);
31 // Notify bluetooth stack that the search needs to be re-issued.
32 void RestartSearch(JNIEnv
* env
, jobject obj
);
34 void ShowBluetoothOverviewLink(JNIEnv
* env
, jobject obj
);
35 void ShowBluetoothPairingLink(JNIEnv
* env
, jobject obj
);
36 void ShowBluetoothAdapterOffLink(JNIEnv
* env
, jobject obj
);
38 static bool Register(JNIEnv
* env
);
41 base::android::ScopedJavaGlobalRef
<jobject
> java_dialog_
;
43 BluetoothChooser::EventHandler event_handler_
;
46 #endif // CHROME_BROWSER_UI_ANDROID_BLUETOOTH_CHOOSER_ANDROID_H_