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

Unified Diff: chrome/browser/ui/bluetooth/chrome_extension_bluetooth_chooser.cc

Issue 2005443002: Implement bluetooth chooser for Chrome Apps on Mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor_chooser_bubble_ui_cocoa
Patch Set: rebase and address comments Created 4 years, 7 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/bluetooth/chrome_extension_bluetooth_chooser.cc
diff --git a/chrome/browser/ui/bluetooth/chrome_extension_bluetooth_chooser.cc b/chrome/browser/ui/bluetooth/chrome_extension_bluetooth_chooser.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0cc55a04ae090dfe18029da1ff409d54f996743f
--- /dev/null
+++ b/chrome/browser/ui/bluetooth/chrome_extension_bluetooth_chooser.cc
@@ -0,0 +1,40 @@
+// Copyright 2016 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.
+
+#include "chrome/browser/ui/bluetooth/chrome_extension_bluetooth_chooser.h"
+
+#include "chrome/browser/extensions/chrome_extension_chooser_dialog.h"
+#include "chrome/browser/ui/bluetooth/bluetooth_chooser_controller.h"
+#include "content/public/browser/web_contents.h"
+
+ChromeExtensionBluetoothChooser::ChromeExtensionBluetoothChooser(
+ content::RenderFrameHost* frame,
+ const content::BluetoothChooser::EventHandler& event_handler) {
+ bluetooth_chooser_controller_.reset(
+ new BluetoothChooserController(frame, event_handler));
+ chooser_dialog_.reset(new ChromeExtensionChooserDialog(
+ content::WebContents::FromRenderFrameHost(frame)));
+#if defined(OS_MACOSX)
+ chooser_dialog_->ShowDialog(bluetooth_chooser_controller_.get());
+#endif // defined(OS_MACOSX)
+}
+
+ChromeExtensionBluetoothChooser::~ChromeExtensionBluetoothChooser() {}
+
+void ChromeExtensionBluetoothChooser::SetAdapterPresence(
+ AdapterPresence presence) {}
+
+void ChromeExtensionBluetoothChooser::ShowDiscoveryState(DiscoveryState state) {
+}
+
+void ChromeExtensionBluetoothChooser::AddDevice(
+ const std::string& device_id,
+ const base::string16& device_name) {
+ bluetooth_chooser_controller_->AddDevice(device_id, device_name);
+}
+
+void ChromeExtensionBluetoothChooser::RemoveDevice(
+ const std::string& device_id) {
+ bluetooth_chooser_controller_->RemoveDevice(device_id);
+}

Powered by Google App Engine
This is Rietveld 408576698