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

Unified Diff: content/public/browser/bluetooth_chooser.cc

Issue 1315093002: Implement a bluetooth picker dialog for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-add line removed during merge Created 5 years, 4 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: content/public/browser/bluetooth_chooser.cc
diff --git a/content/public/browser/bluetooth_chooser.cc b/content/public/browser/bluetooth_chooser.cc
index 40d4590e3cb69b9babd371d328915f1af7d3cc38..104b5924a7c61dca8040f09de4ba31b88f2db6b2 100644
--- a/content/public/browser/bluetooth_chooser.cc
+++ b/content/public/browser/bluetooth_chooser.cc
@@ -4,8 +4,48 @@
#include "content/public/browser/bluetooth_chooser.h"
+#include "content/public/browser/web_contents_delegate.h"
+#include "ui/base/page_transition_types.h"
+
+namespace {
+
+// TODO(finnur): These need to be actual HC article links.
+const char kOverviewURL[] = "https://www.google.com/?gws_rd=ssl#q=overview";
+const char kPairingURL[] = "https://www.google.com/?gws_rd=ssl#q=pairing";
+const char kAdapterOffURL[] = "https://www.google.com/?gws_rd=ssl#q=adapteroff";
+
+void ShowLink(content::WebContents* web_contents, const GURL& link) {
+ content::OpenURLParams params = content::OpenURLParams(
+ link,
+ content::Referrer(),
+ NEW_FOREGROUND_TAB,
+ ui::PageTransition::PAGE_TRANSITION_LINK,
+ false);
+ content::WebContentsDelegate* delegate = web_contents->GetDelegate();
+ delegate->OpenURLFromTab(web_contents, params);
+}
+
+} // namespace
+
namespace content {
BluetoothChooser::~BluetoothChooser() {}
+void BluetoothChooser::ShowOverviewLink(
+ content::WebContents* web_contents) {
+ ShowLink(web_contents, GURL(kOverviewURL));
+}
+
+void BluetoothChooser::ShowPairingLink(
+ content::WebContents* web_contents) {
+ ShowLink(web_contents, GURL(kPairingURL));
+}
+
+void BluetoothChooser::ShowAdapterOffLink(
+ content::WebContents* web_contents) {
+ ShowLink(web_contents, GURL(kAdapterOffURL));
+
+}
+
+
} // namespace content
« content/public/browser/bluetooth_chooser.h ('K') | « content/public/browser/bluetooth_chooser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698