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

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

Issue 2344133003: Add help link when Bluetooth adapter is off for WebBluetooth chooser (Closed)
Patch Set: address more comments Created 4 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/bluetooth/bluetooth_chooser_controller.cc
diff --git a/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc b/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
index fe260f303e284095a426acc9a226da4cc4a2355e..f658f69fe277d266ea952c9ce1091d047698ca27 100644
--- a/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
+++ b/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
@@ -40,9 +40,7 @@ BluetoothChooserController::BluetoothChooserController(
: ChooserController(owner,
IDS_BLUETOOTH_DEVICE_CHOOSER_PROMPT_ORIGIN,
IDS_BLUETOOTH_DEVICE_CHOOSER_PROMPT_EXTENSION_NAME),
- event_handler_(event_handler),
- no_devices_text_(l10n_util::GetStringUTF16(
- IDS_BLUETOOTH_DEVICE_CHOOSER_NO_DEVICES_FOUND_PROMPT)) {}
+ event_handler_(event_handler) {}
BluetoothChooserController::~BluetoothChooserController() {}
@@ -51,7 +49,8 @@ bool BluetoothChooserController::ShouldShowIconBeforeText() const {
}
base::string16 BluetoothChooserController::GetNoOptionsText() const {
- return no_devices_text_;
+ return l10n_util::GetStringUTF16(
+ IDS_BLUETOOTH_DEVICE_CHOOSER_NO_DEVICES_FOUND_PROMPT);
}
base::string16 BluetoothChooserController::GetOkButtonLabel() const {
@@ -97,6 +96,13 @@ void BluetoothChooserController::RefreshOptions() {
event_handler_.Run(content::BluetoothChooser::Event::RESCAN, std::string());
}
+void BluetoothChooserController::OpenAdapterOffHelpUrl() const {
+ GetBrowser()->OpenURL(content::OpenURLParams(
+ GURL(chrome::kBluetoothAdapterOffHelpURL), content::Referrer(),
+ WindowOpenDisposition::NEW_FOREGROUND_TAB,
+ ui::PAGE_TRANSITION_AUTO_TOPLEVEL, false /* is_renderer_initialized */));
+}
+
base::string16 BluetoothChooserController::GetStatus() const {
return status_text_;
}
@@ -142,8 +148,6 @@ void BluetoothChooserController::OnAdapterPresenceChanged(
NOTREACHED();
break;
case content::BluetoothChooser::AdapterPresence::POWERED_OFF:
- no_devices_text_ =
- l10n_util::GetStringUTF16(IDS_BLUETOOTH_DEVICE_CHOOSER_ADAPTER_OFF);
status_text_ = base::string16();
if (view()) {
view()->OnAdapterEnabledChanged(
@@ -151,8 +155,6 @@ void BluetoothChooserController::OnAdapterPresenceChanged(
}
break;
case content::BluetoothChooser::AdapterPresence::POWERED_ON:
- no_devices_text_ = l10n_util::GetStringUTF16(
- IDS_BLUETOOTH_DEVICE_CHOOSER_NO_DEVICES_FOUND_PROMPT);
status_text_ =
l10n_util::GetStringUTF16(IDS_BLUETOOTH_DEVICE_CHOOSER_RE_SCAN);
if (view()) {

Powered by Google App Engine
This is Rietveld 408576698