Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5159)

Unified Diff: chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc

Issue 521953002: Do not show irrelevant registration promos to supervised and guest users (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc
diff --git a/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc b/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc
index 9fed8fc7ef4f25e103125d2e8274337839867a64..69abbabe5dd9bfe87b32883eebbe32a5be887435 100644
--- a/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc
+++ b/chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.cc
@@ -562,8 +562,9 @@ void LocalDiscoveryUIHandler::PrivetClientToV3(
void LocalDiscoveryUIHandler::CheckUserLoggedIn() {
base::FundamentalValue logged_in_value(!GetSyncAccount().empty());
- web_ui()->CallJavascriptFunction("local_discovery.setUserLoggedIn",
- logged_in_value);
+ base::FundamentalValue is_supervised_value(IsUserSupervisedOrOffTheRecord());
+ web_ui()->CallJavascriptFunction(
+ "local_discovery.setUserLoggedIn", logged_in_value, is_supervised_value);
}
void LocalDiscoveryUIHandler::CheckListingDone() {
@@ -634,6 +635,12 @@ void LocalDiscoveryUIHandler::CreatePrivetV3Client(
privet_resolution_->Start();
}
+bool LocalDiscoveryUIHandler::IsUserSupervisedOrOffTheRecord() {
+ Profile* profile = Profile::FromWebUI(web_ui());
+
+ return profile->IsSupervised() || profile->IsOffTheRecord();
+}
+
#if defined(CLOUD_PRINT_CONNECTOR_UI_AVAILABLE)
void LocalDiscoveryUIHandler::StartCloudPrintConnector() {
Profile* profile = Profile::FromWebUI(web_ui());
« no previous file with comments | « chrome/browser/ui/webui/local_discovery/local_discovery_ui_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698