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

Unified Diff: chrome/browser/chromeos/first_run/goodies_displayer.cc

Issue 2558103002: No Goodies for Supervised Users (Closed)
Patch Set: Created 4 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/first_run/goodies_displayer.cc
diff --git a/chrome/browser/chromeos/first_run/goodies_displayer.cc b/chrome/browser/chromeos/first_run/goodies_displayer.cc
index 01b02d74119ddbfff0ce46a4517d6fea601bd999..7a6449f7e9039a7c98f31b0ee4ba6f22e444b6e0 100644
--- a/chrome/browser/chromeos/first_run/goodies_displayer.cc
+++ b/chrome/browser/chromeos/first_run/goodies_displayer.cc
@@ -18,6 +18,8 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
+#include "components/user_manager/user.h"
+#include "components/user_manager/user_manager.h"
#include "content/public/browser/browser_thread.h"
namespace chromeos {
@@ -106,12 +108,13 @@ void GoodiesDisplayer::Delete() {
// new Chromebooks; when appropriate, it uses pref to mark page as shown,
// removes itself from BrowserListObservers, and deletes itself.
void GoodiesDisplayer::OnBrowserSetLastActive(Browser* browser) {
- // 1. Must be an actual tabbed brower window.
+ // 1. Must be an actual tabbed browser window.
if (browser->type() != Browser::TYPE_TABBED)
return;
- // 2. Not guest or incognito session (keep observing).
- if (browser->profile()->IsOffTheRecord())
+ // 2. Not guest or incognito session or supervised user (keep observing).
+ user_manager::User* user = user_manager::UserManager::Get()->GetActiveUser();
+ if (browser->profile()->IsOffTheRecord() || (user && user->IsSupervised()))
return;
PrefService* local_state = g_browser_process->local_state();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698