From 8c5ee7703eed1efa0a5f1bd532c3ac9c7f8e9242 Mon Sep 17 00:00:00 2001 From: khmel Date: Fri, 11 Mar 2016 16:12:37 -0800 Subject: arc: Disable any UI for supervised profiles. We cannot fetch authorization code for supervised profiles. Therefore we cannot start Arc and should disable any Arc related UI. BUG=593542 TEST=Sign-in with supervised profile. Arc is not started, there is no Arc settins in Chrome::Settings and there is no OptIn UI and Arc welcome notification. Signed in with normal profile and everything works as before. Review URL: https://codereview.chromium.org/1781933002 Cr-Commit-Position: refs/heads/master@{#380798} --- chrome/browser/chromeos/arc/arc_auth_service.cc | 5 +++++ chrome/browser/ui/webui/options/browser_options_handler.cc | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/chrome/browser/chromeos/arc/arc_auth_service.cc b/chrome/browser/chromeos/arc/arc_auth_service.cc index 86ae290..facd3f3 100644 --- a/chrome/browser/chromeos/arc/arc_auth_service.cc +++ b/chrome/browser/chromeos/arc/arc_auth_service.cc @@ -150,6 +150,11 @@ void ArcAuthService::OnPrimaryUserProfilePrepared(Profile* profile) { Shutdown(); + if (profile->IsLegacySupervised()) { + VLOG(2) << "Supervised profiles are not supported in Arc."; + return; + } + profile_ = profile; // Reuse storage used in ARC OptIn platform app. const std::string site_url = diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc index c631bec..6bd2743 100644 --- a/chrome/browser/ui/webui/options/browser_options_handler.cc +++ b/chrome/browser/ui/webui/options/browser_options_handler.cc @@ -1063,7 +1063,8 @@ void BrowserOptionsHandler::InitializePage() { if (!arc::ArcBridgeService::GetEnabled( base::CommandLine::ForCurrentProcess()) || - arc::ArcAuthService::IsOptInVerificationDisabled()) { + arc::ArcAuthService::IsOptInVerificationDisabled() || + profile->IsLegacySupervised()) { web_ui()->CallJavascriptFunction("BrowserOptions.hideAndroidAppsSection"); } #endif -- cgit v1.1