Commit a3a79bee authored by James Cook's avatar James Cook Committed by Commit Bot

chromeos: Open OS settings from bluetooth chooser "adapter off" link

The SplitSettings project has moved OS-specific settings, including
Bluetooth, into a separate WebUI surface. Directly open the Bluetooth
settings subpage from the bluetooth chooser "adapter off" link,
rather than opening browser settings and trying to do a search.

Bug: 994896
Test: Turn adapter off, open https://permission.site, click bluetooth, click "Turn on bluetooth" link
Change-Id: I602d979c88f3d89c82702e92ad3bb81230f03698
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1771841Reviewed-by: default avatarReilly Grant <reillyg@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690420}
parent 15402250
...@@ -19,6 +19,11 @@ ...@@ -19,6 +19,11 @@
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "url/gurl.h" #include "url/gurl.h"
#if defined(OS_CHROMEOS)
#include "chrome/browser/ui/settings_window_manager_chromeos.h"
#include "chrome/common/webui_url_constants.h"
#endif // defined(OS_CHROMEOS)
namespace { namespace {
Browser* GetBrowser() { Browser* GetBrowser() {
...@@ -101,10 +106,17 @@ void BluetoothChooserController::RefreshOptions() { ...@@ -101,10 +106,17 @@ void BluetoothChooserController::RefreshOptions() {
} }
void BluetoothChooserController::OpenAdapterOffHelpUrl() const { void BluetoothChooserController::OpenAdapterOffHelpUrl() const {
#if defined(OS_CHROMEOS)
// Chrome OS can directly link to the OS setting to turn on the adapter.
chrome::SettingsWindowManager::GetInstance()->ShowOSSettings(
GetBrowser()->profile(), chrome::kBluetoothSubPage);
#else
// For other operating systems, show a help center page in a tab.
GetBrowser()->OpenURL(content::OpenURLParams( GetBrowser()->OpenURL(content::OpenURLParams(
GURL(chrome::kBluetoothAdapterOffHelpURL), content::Referrer(), GURL(chrome::kBluetoothAdapterOffHelpURL), content::Referrer(),
WindowOpenDisposition::NEW_FOREGROUND_TAB, WindowOpenDisposition::NEW_FOREGROUND_TAB,
ui::PAGE_TRANSITION_AUTO_TOPLEVEL, false /* is_renderer_initialized */)); ui::PAGE_TRANSITION_AUTO_TOPLEVEL, false /* is_renderer_initialized */));
#endif
} }
base::string16 BluetoothChooserController::GetStatus() const { base::string16 BluetoothChooserController::GetStatus() const {
......
...@@ -18,11 +18,7 @@ const char kAdvancedProtectionDownloadLearnMoreURL[] = ...@@ -18,11 +18,7 @@ const char kAdvancedProtectionDownloadLearnMoreURL[] =
"https://support.google.com/accounts/?p=ap_faq"; "https://support.google.com/accounts/?p=ap_faq";
const char kBluetoothAdapterOffHelpURL[] = const char kBluetoothAdapterOffHelpURL[] =
#if defined(OS_CHROMEOS)
"chrome://settings/?search=bluetooth";
#else
"https://support.google.com/chrome?p=bluetooth"; "https://support.google.com/chrome?p=bluetooth";
#endif
const char kCastCloudServicesHelpURL[] = const char kCastCloudServicesHelpURL[] =
"https://support.google.com/chromecast/?p=casting_cloud_services"; "https://support.google.com/chromecast/?p=casting_cloud_services";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment