Commit 81bdcc56 authored by Nicolas Ouellet-payeur's avatar Nicolas Ouellet-payeur Committed by Commit Bot

Don't show managed UI in demo mode

Bug: 924832
Change-Id: I6e06e81aea864594caf4ae359064032ad8d22f42
Reviewed-on: https://chromium-review.googlesource.com/c/1434075Reviewed-by: default avatarMichael Giuffrida <michaelpg@chromium.org>
Reviewed-by: default avatarMichael Wasserman <msw@chromium.org>
Commit-Queue: Nicolas Ouellet-Payeur <nicolaso@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625810}
parent 4fd16419
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "chrome/common/chrome_features.h" #include "chrome/common/chrome_features.h"
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/login/demo_mode/demo_session.h"
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "components/user_manager/user_manager.h" #include "components/user_manager/user_manager.h"
...@@ -25,6 +26,12 @@ bool ShouldDisplayManagedUi(Profile* profile) { ...@@ -25,6 +26,12 @@ bool ShouldDisplayManagedUi(Profile* profile) {
if (!base::FeatureList::IsEnabled(features::kShowManagedUi)) if (!base::FeatureList::IsEnabled(features::kShowManagedUi))
return false; return false;
#if defined(OS_CHROMEOS)
// Don't show the UI in demo mode.
if (chromeos::DemoSession::IsDeviceInDemoMode())
return false;
#endif
// This profile may have policies configured. // This profile may have policies configured.
auto* profile_connector = auto* profile_connector =
policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile); policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile);
......
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