Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_BROWSER_UI_ANDROID_BLUETOOTH_CHOOSER_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_UI_ANDROID_BLUETOOTH_CHOOSER_ANDROID_H_ |
| 6 #define CHROME_BROWSER_UI_ANDROID_BLUETOOTH_CHOOSER_ANDROID_H_ | 6 #define CHROME_BROWSER_UI_ANDROID_BLUETOOTH_CHOOSER_ANDROID_H_ |
| 7 | 7 |
| 8 #include "base/android/scoped_java_ref.h" | 8 #include "base/android/scoped_java_ref.h" |
| 9 #include "content/public/browser/bluetooth_chooser.h" | 9 #include "content/public/browser/bluetooth_chooser.h" |
| 10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
| 11 | 11 |
| 12 namespace url { | 12 namespace url { |
| 13 class Origin; | 13 class Origin; |
| 14 } | 14 } |
| 15 | 15 |
| 16 // Represents a way to ask the user to select a Bluetooth device from a list of | 16 // Represents a way to ask the user to select a Bluetooth device from a list of |
| 17 // options. | 17 // options. |
| 18 class BluetoothChooserAndroid : public content::BluetoothChooser { | 18 class BluetoothChooserAndroid : public content::BluetoothChooser { |
| 19 public: | 19 public: |
| 20 BluetoothChooserAndroid(content::RenderFrameHost* frame, | 20 BluetoothChooserAndroid(content::RenderFrameHost* frame, |
|
Jeffrey Yasskin
2016/02/18 02:17:24
Could you add a comment here that the event_handle
ortuno
2016/02/18 18:26:33
Done.
| |
| 21 const EventHandler& event_handler); | 21 const EventHandler& event_handler); |
| 22 ~BluetoothChooserAndroid() override; | 22 ~BluetoothChooserAndroid() override; |
| 23 | 23 |
| 24 // content::BluetoothChooser: | 24 // content::BluetoothChooser: |
| 25 bool CanAskForScanningPermission() override; | 25 bool CanAskForScanningPermission() override; |
| 26 void SetAdapterPresence(AdapterPresence presence) override; | 26 void SetAdapterPresence(AdapterPresence presence) override; |
| 27 void ShowDiscoveryState(DiscoveryState state) override; | 27 void ShowDiscoveryState(DiscoveryState state) override; |
| 28 void AddDevice(const std::string& device_id, | 28 void AddDevice(const std::string& device_id, |
| 29 const base::string16& device_name) override; | 29 const base::string16& device_name) override; |
| 30 void RemoveDevice(const std::string& device_id) override; | 30 void RemoveDevice(const std::string& device_id) override; |
| 31 | 31 |
| 32 // Report the dialog's result. | 32 // Report the dialog's result. |
| 33 void OnDialogFinished(JNIEnv* env, | 33 void OnDialogFinished(JNIEnv* env, |
| 34 const base::android::JavaParamRef<jobject>& obj, | 34 const base::android::JavaParamRef<jobject>& obj, |
| 35 jint event_type, | 35 jint event_type, |
| 36 const base::android::JavaParamRef<jstring>& device_id); | 36 const base::android::JavaParamRef<jstring>& device_id); |
| 37 | 37 |
| 38 // Notify bluetooth stack that the search needs to be re-issued. | 38 // Notify bluetooth stack that the search needs to be re-issued. |
| 39 void RestartSearch(JNIEnv* env, | 39 void RestartSearch(JNIEnv* env, |
| 40 const base::android::JavaParamRef<jobject>& obj); | 40 const base::android::JavaParamRef<jobject>& obj); |
| 41 | 41 |
| 42 void ShowBluetoothOverviewLink( | 42 void ShowBluetoothOverviewLink( |
| 43 JNIEnv* env, | 43 JNIEnv* env, |
| 44 const base::android::JavaParamRef<jobject>& obj); | 44 const base::android::JavaParamRef<jobject>& obj); |
| 45 void ShowBluetoothPairingLink( | |
| 46 JNIEnv* env, | |
| 47 const base::android::JavaParamRef<jobject>& obj); | |
| 48 void ShowBluetoothAdapterOffLink( | 45 void ShowBluetoothAdapterOffLink( |
| 49 JNIEnv* env, | 46 JNIEnv* env, |
| 50 const base::android::JavaParamRef<jobject>& obj); | 47 const base::android::JavaParamRef<jobject>& obj); |
| 51 void ShowNeedLocationPermissionLink( | 48 void ShowNeedLocationPermissionLink( |
| 52 JNIEnv* env, | 49 JNIEnv* env, |
| 53 const base::android::JavaParamRef<jobject>& obj); | 50 const base::android::JavaParamRef<jobject>& obj); |
| 54 | 51 |
| 55 static bool Register(JNIEnv* env); | 52 static bool Register(JNIEnv* env); |
| 56 | 53 |
| 57 private: | 54 private: |
| 55 void OpenURL(const char url[]); | |
|
Jeffrey Yasskin
2016/02/18 02:17:24
Use "const char* url". The behavior of [] in argum
ortuno
2016/02/18 18:26:33
Done.
| |
| 58 base::android::ScopedJavaGlobalRef<jobject> java_dialog_; | 56 base::android::ScopedJavaGlobalRef<jobject> java_dialog_; |
| 59 | 57 |
| 58 content::WebContents* web_contents_; | |
| 60 BluetoothChooser::EventHandler event_handler_; | 59 BluetoothChooser::EventHandler event_handler_; |
| 61 }; | 60 }; |
| 62 | 61 |
| 63 #endif // CHROME_BROWSER_UI_ANDROID_BLUETOOTH_CHOOSER_ANDROID_H_ | 62 #endif // CHROME_BROWSER_UI_ANDROID_BLUETOOTH_CHOOSER_ANDROID_H_ |
| OLD | NEW |