Commit 23e754d8 authored by May Lippert's avatar May Lippert Committed by Commit Bot

[Settings] Fix hardcoded path to chrome://settings in printing code

Some parts of the printing code refer to chrome://settings directly
while using SettingsWindowManager to open the URL. This results in the
browser settings opening in the OS settings surface when the split
settings flag is on.

Also fix an issue where the main page behavior is not opening the
advanced section correctly when opening OS settings to an advanced
route.

BUG=980264

Change-Id: Ib69e17790b880ef068c059d4e6133c2e05e0448b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1686543Reviewed-by: default avatarZentaro Kavanagh <zentaro@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: May Lippert <maybelle@chromium.org>
Cr-Commit-Position: refs/heads/master@{#675779}
parent a7ef71bd
......@@ -81,11 +81,8 @@ void UsbPrinterNotification::Click(
// Body of notification clicked.
visible_ = false;
if (type_ == Type::kConfigurationRequired) {
auto* const settings_manager =
chrome::SettingsWindowManager::GetInstance();
settings_manager->ShowChromePageForProfile(
profile_,
chrome::GetSettingsUrl(chrome::kNativePrintingSettingsSubPage));
chrome::SettingsWindowManager::GetInstance()->ShowOSSettings(
profile_, chrome::kNativePrintingSettingsSubPage);
}
return;
}
......
......@@ -214,7 +214,8 @@
type="chrome_html" />
<structure name="IDR_OS_SETTINGS_MAIN_PAGE_BEHAVIOR_JS"
file="settings_page/main_page_behavior.js"
type="chrome_html" />
type="chrome_html"
preprocess="true" />
<structure name="IDR_OS_SETTINGS_SETTINGS_VARS_CSS_HTML"
file="settings_vars_css.html"
type="chrome_html" />
......
......@@ -140,7 +140,12 @@ cr.define('settings', function() {
* @private
*/
shouldExpandAdvanced_: function(route) {
return this.tagName == 'SETTINGS-BASIC-PAGE' &&
return (
this.tagName == 'SETTINGS-BASIC-PAGE'
// <if expr="chromeos">
|| this.tagName == 'OS-SETTINGS-PAGE'
// </if>
) &&
settings.routes.ADVANCED && settings.routes.ADVANCED.contains(route);
},
......
......@@ -896,10 +896,8 @@ void PrintPreviewHandler::HandleClosePreviewDialog(
#if defined(OS_CHROMEOS)
void PrintPreviewHandler::HandleOpenPrinterSettings(
const base::ListValue* args) {
auto* const settings_manager = chrome::SettingsWindowManager::GetInstance();
settings_manager->ShowChromePageForProfile(
Profile::FromWebUI(web_ui()),
chrome::GetSettingsUrl(chrome::kPrintingSettingsSubPage));
chrome::SettingsWindowManager::GetInstance()->ShowOSSettings(
Profile::FromWebUI(web_ui()), chrome::kPrintingSettingsSubPage);
}
#endif
......
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