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 #ifndef CHROME_BROWSER_UI_ANDROID_BLUETOOTH_CHOOSER_ANDROID_H_ |
| 6 #define CHROME_BROWSER_UI_ANDROID_BLUETOOTH_CHOOSER_ANDROID_H_ |
| 7 |
| 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "content/public/browser/bluetooth_chooser.h" |
| 10 #include "content/public/browser/web_contents.h" |
| 11 |
| 12 // Represents a way to ask the user to select a Bluetooth device from a list of |
| 13 // options. |
| 14 class BluetoothChooserAndroid : public content::BluetoothChooser { |
| 15 public: |
| 16 BluetoothChooserAndroid(content::WebContents* web_contents, |
| 17 const EventHandler& event_handler, |
| 18 const GURL& origin); |
| 19 ~BluetoothChooserAndroid() override; |
| 20 |
| 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; |
| 27 |
| 28 // Report which device was selected (device_id). |
| 29 void OnDeviceSelected(JNIEnv* env, jobject obj, jstring device_id); |
| 30 |
| 31 // Notify bluetooth stack that the search needs to be re-issued. |
| 32 void RestartSearch(JNIEnv* env, jobject obj); |
| 33 |
| 34 void ShowBluetoothOverviewLink(JNIEnv* env, jobject obj); |
| 35 void ShowBluetoothPairingLink(JNIEnv* env, jobject obj); |
| 36 void ShowBluetoothAdapterOffLink(JNIEnv* env, jobject obj); |
| 37 |
| 38 static bool Register(JNIEnv* env); |
| 39 |
| 40 private: |
| 41 base::android::ScopedJavaGlobalRef<jobject> java_dialog_; |
| 42 |
| 43 BluetoothChooser::EventHandler event_handler_; |
| 44 }; |
| 45 |
| 46 #endif // CHROME_BROWSER_UI_ANDROID_BLUETOOTH_CHOOSER_ANDROID_H_ |
OLD | NEW |