Commit ef670148 authored by Gavin Williams's avatar Gavin Williams Committed by Commit Bot

Use OffTheRecord profile in Guest mode to open browser windows

This change guarantees the USB printer config and the print job
notfications only use the OffTheRecord(OTR) profile to open System Web
Apps(SWA) in Guest mode. There is an existing check
(https://source.chromium.org/chromium/chromium/src/+/master:chrome/browser/ui/browser.cc;l=471)
that only OTR guest profiles are allowed to open SWAs.

Change-Id: I78aef11b2d2cb8377f17ecd90f494828119ddf1a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2372909Reviewed-by: default avatarZentaro Kavanagh <zentaro@chromium.org>
Reviewed-by: default avatarSean Kau <skau@chromium.org>
Commit-Queue: Gavin Williams <gavinwill@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801834}
parent 1707b80d
......@@ -133,8 +133,13 @@ void CupsPrintJobNotification::Click(
const base::Optional<base::string16>& reply) {
if (!button_index) {
if (base::FeatureList::IsEnabled(features::kPrintJobManagementApp)) {
// If we are in guest mode then we need to use the OffTheRecord profile to
// open the Print Manageament App. There is a check in Browser::Browser
// that only OffTheRecord profiles can open browser windows in guest mode.
chrome::ShowPrintManagementApp(
profile_, PrintManagementAppEntryPoint::kNotification);
profile_->IsGuestSession() ? profile_->GetPrimaryOTRProfile()
: profile_,
PrintManagementAppEntryPoint::kNotification);
}
return;
}
......
......@@ -81,8 +81,13 @@ void UsbPrinterNotification::Click(
// Body of notification clicked.
visible_ = false;
if (type_ == Type::kConfigurationRequired) {
// If we are in guest mode then we need to use the OffTheRecord profile to
// open the Settings page. There is a check in Browser::Browser that only
// OffTheRecord profiles can open browser windows in guest mode.
chrome::SettingsWindowManager::GetInstance()->ShowOSSettings(
profile_, chromeos::settings::mojom::kPrintingDetailsSubpagePath);
profile_->IsGuestSession() ? profile_->GetPrimaryOTRProfile()
: profile_,
chromeos::settings::mojom::kPrintingDetailsSubpagePath);
}
return;
}
......
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