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

Unified Diff: chrome/browser/ui/android/bluetooth_chooser_android.h

Issue 1315093002: Implement a bluetooth picker dialog for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove redundant include Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/android/bluetooth_chooser_android.h
diff --git a/chrome/browser/ui/android/bluetooth_chooser_android.h b/chrome/browser/ui/android/bluetooth_chooser_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..c7c05168bc9a3bf69137efa21a1af01f69c2d6bc
--- /dev/null
+++ b/chrome/browser/ui/android/bluetooth_chooser_android.h
@@ -0,0 +1,46 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_ANDROID_BLUETOOTH_CHOOSER_ANDROID_H_
+#define CHROME_BROWSER_UI_ANDROID_BLUETOOTH_CHOOSER_ANDROID_H_
+
+#include "base/android/scoped_java_ref.h"
+#include "content/public/browser/bluetooth_chooser.h"
+#include "content/public/browser/web_contents.h"
+
+// Represents a way to ask the user to select a Bluetooth device from a list of
+// options.
+class BluetoothChooserAndroid : public content::BluetoothChooser {
+ public:
+ BluetoothChooserAndroid(content::WebContents* web_contents,
+ const EventHandler& event_handler,
+ const GURL& origin);
+ ~BluetoothChooserAndroid() override;
+
+ // content::BluetoothChooser:
+ void SetAdapterPresence(AdapterPresence presence) override;
+ void ShowDiscoveryState(DiscoveryState state) override;
+ void AddDevice(const std::string& device_id,
+ const base::string16& device_name) override;
+ void RemoveDevice(const std::string& device_id) override;
+
+ // Report which device was selected (device_id).
+ void OnDeviceSelected(JNIEnv* env, jobject obj, jstring device_id);
+
+ // Notify bluetooth stack that the search needs to be re-issued.
+ void RestartSearch(JNIEnv* env, jobject obj);
+
+ void ShowBluetoothOverviewLink(JNIEnv* env, jobject obj);
+ void ShowBluetoothPairingLink(JNIEnv* env, jobject obj);
+ void ShowBluetoothAdapterOffLink(JNIEnv* env, jobject obj);
+
+ static bool Register(JNIEnv* env);
+
+ private:
+ base::android::ScopedJavaGlobalRef<jobject> java_dialog_;
+
+ BluetoothChooser::EventHandler event_handler_;
+};
+
+#endif // CHROME_BROWSER_UI_ANDROID_BLUETOOTH_CHOOSER_ANDROID_H_
« no previous file with comments | « chrome/browser/android/chrome_web_contents_delegate_android.cc ('k') | chrome/browser/ui/android/bluetooth_chooser_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698