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

Unified Diff: chrome/browser/chromeos/login/multi_profile_user_controller.h

Issue 286933002: [cros login] Split login related classes into subfolders. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix includes in new tests Created 6 years, 7 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
Index: chrome/browser/chromeos/login/multi_profile_user_controller.h
diff --git a/chrome/browser/chromeos/login/multi_profile_user_controller.h b/chrome/browser/chromeos/login/multi_profile_user_controller.h
deleted file mode 100644
index 81656cc39df2ac36c7bb60248e0faaf25f493ade..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/login/multi_profile_user_controller.h
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_MULTI_PROFILE_USER_CONTROLLER_H_
-#define CHROME_BROWSER_CHROMEOS_LOGIN_MULTI_PROFILE_USER_CONTROLLER_H_
-
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/memory/scoped_vector.h"
-
-class PrefChangeRegistrar;
-class PrefRegistrySimple;
-class PrefService;
-class Profile;
-
-namespace user_prefs {
-class PrefRegistrySyncable;
-}
-
-namespace chromeos {
-
-class MultiProfileUserControllerDelegate;
-class UserManager;
-
-// MultiProfileUserController decides whether a user is allowed to be in a
-// multi-profiles session. It caches the multi-profile user behavior pref backed
-// by user policy into local state so that the value is available before the
-// user login and checks if the meaning of the value is respected.
-class MultiProfileUserController {
- public:
- // Return value of IsUserAllowedInSession().
- enum UserAllowedInSessionResult {
- // User is allowed in multi-profile session.
- ALLOWED,
-
- // Owner of the device is not allowed to be added as a secondary user.
- NOT_ALLOWED_OWNER_AS_SECONDARY,
-
- // Not allowed since it is potentially "tainted" with policy-pushed
- // certificates.
- NOT_ALLOWED_POLICY_CERT_TAINTED,
-
- // Not allowed since primary user is already "tainted" with policy-pushed
- // certificates.
- NOT_ALLOWED_PRIMARY_POLICY_CERT_TAINTED,
-
- // Not allowed since primary user policy forbids it to be part of
- // multi-profiles session.
- NOT_ALLOWED_PRIMARY_USER_POLICY_FORBIDS,
-
- // Not allowed since user policy forbids this user being part of
- // multi-profiles session. Either 'primary-only' or 'not-allowed'.
- NOT_ALLOWED_POLICY_FORBIDS
- };
-
- MultiProfileUserController(MultiProfileUserControllerDelegate* delegate,
- PrefService* local_state);
- ~MultiProfileUserController();
-
- static void RegisterPrefs(PrefRegistrySimple* registry);
- static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
-
- // Returns the cached policy value for |user_email|.
- std::string GetCachedValue(const std::string& user_email) const;
-
- // Returns UserAllowedInSessionResult enum that describe whether the user is
- // allowed to be in the current session.
- UserAllowedInSessionResult IsUserAllowedInSession(
- const std::string& user_email) const;
-
- // Starts to observe the multiprofile user behavior pref of the given profile.
- void StartObserving(Profile* user_profile);
-
- // Removes the cached values for the given user.
- void RemoveCachedValues(const std::string& user_email);
-
- // Possible behavior values.
- static const char kBehaviorUnrestricted[];
- static const char kBehaviorPrimaryOnly[];
- static const char kBehaviorNotAllowed[];
-
- private:
- friend class MultiProfileUserControllerTest;
-
- // Sets the cached policy value.
- void SetCachedValue(const std::string& user_email,
- const std::string& behavior);
-
- // Checks if all users are allowed in the current session.
- void CheckSessionUsers();
-
- // Invoked when user behavior pref value changes.
- void OnUserPrefChanged(Profile* profile);
-
- MultiProfileUserControllerDelegate* delegate_; // Not owned.
- PrefService* local_state_; // Not owned.
- ScopedVector<PrefChangeRegistrar> pref_watchers_;
-
- DISALLOW_COPY_AND_ASSIGN(MultiProfileUserController);
-};
-
-} // namespace chromeos
-
-#endif // CHROME_BROWSER_CHROMEOS_LOGIN_MULTI_PROFILE_USER_CONTROLLER_H_
« no previous file with comments | « chrome/browser/chromeos/login/mount_manager.cc ('k') | chrome/browser/chromeos/login/multi_profile_user_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698