Home | History | Annotate | Download | only in profiles
      1 // Copyright 2013 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_PROFILES_PROFILES_STATE_H_
      6 #define CHROME_BROWSER_PROFILES_PROFILES_STATE_H_
      7 
      8 #include <vector>
      9 #include "base/strings/string16.h"
     10 
     11 class Browser;
     12 class PrefRegistrySimple;
     13 class Profile;
     14 class SigninErrorController;
     15 namespace base { class FilePath; }
     16 
     17 namespace profiles {
     18 
     19 // Checks if multiple profiles is enabled.
     20 bool IsMultipleProfilesEnabled();
     21 
     22 // Returns the path to the default profile directory, based on the given
     23 // user data directory.
     24 base::FilePath GetDefaultProfileDir(const base::FilePath& user_data_dir);
     25 
     26 // Register multi-profile related preferences in Local State.
     27 void RegisterPrefs(PrefRegistrySimple* registry);
     28 
     29 // Returns the display name of the active on-the-record profile (or guest)
     30 // used in the avatar button. If there is only one local profile present, it
     31 // will return IDS_SINGLE_PROFILE_DISPLAY_NAME, unless the profile has a
     32 // user entered custom name.
     33 base::string16 GetAvatarNameForProfile(Profile* profile);
     34 
     35 // Update the name of |profile| to |new_profile_name|. This updates the
     36 // profile preferences, which triggers an update in the ProfileInfoCache.
     37 void UpdateProfileName(Profile* profile,
     38                        const base::string16& new_profile_name);
     39 
     40 // Returns the list of secondary accounts for a specific |profile|, which is
     41 // all the email addresses associated with the profile that are not equal to
     42 // the |primary_account|.
     43 std::vector<std::string> GetSecondaryAccountsForProfile(
     44     Profile* profile,
     45     const std::string& primary_account);
     46 
     47 // Returns whether the |browser|'s profile is a non-incognito or guest profile.
     48 // The distinction is needed because guest profiles are implemented as
     49 // incognito profiles.
     50 bool IsRegularOrGuestSession(Browser* browser);
     51 
     52 // If the --google-profile-info flag is turned on, starts an update for a new
     53 // version of the Gaia profile picture.
     54 void UpdateGaiaProfilePhotoIfNeeded(Profile* profile);
     55 
     56 // Returns the sign-in error controller for the given profile.  Some profiles,
     57 // like guest profiles, may not have a controller so this function may return
     58 // NULL.
     59 SigninErrorController* GetSigninErrorController(Profile* profile);
     60 
     61 }  // namespace profiles
     62 
     63 #endif  // CHROME_BROWSER_PROFILES_PROFILES_STATE_H_
     64