Home | History | Annotate | Download | only in profiles
      1 // Copyright (c) 2011 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_PROFILE_INFO_INTERFACE_H_
      6 #define CHROME_BROWSER_PROFILES_PROFILE_INFO_INTERFACE_H_
      7 
      8 #include "base/files/file_path.h"
      9 #include "base/strings/string16.h"
     10 
     11 namespace gfx {
     12 class Image;
     13 }
     14 
     15 // This abstract interface is used to query the profiles backend for information
     16 // about the different profiles. Its sole concrete implementation is the
     17 // ProfileInfoCache. This interface exists largely to assist in testing.
     18 class ProfileInfoInterface {
     19  public:
     20   virtual size_t GetNumberOfProfiles() const = 0;
     21 
     22   virtual size_t GetIndexOfProfileWithPath(
     23       const base::FilePath& profile_path) const = 0;
     24 
     25   virtual base::string16 GetNameOfProfileAtIndex(size_t index) const = 0;
     26 
     27   virtual base::string16 GetShortcutNameOfProfileAtIndex(
     28       size_t index) const = 0;
     29 
     30   virtual base::FilePath GetPathOfProfileAtIndex(size_t index) const = 0;
     31 
     32   virtual base::string16 GetUserNameOfProfileAtIndex(size_t index) const = 0;
     33 
     34   virtual const gfx::Image& GetAvatarIconOfProfileAtIndex(
     35       size_t index) const = 0;
     36 
     37   virtual std::string GetLocalAuthCredentialsOfProfileAtIndex(
     38       size_t index) const = 0;
     39 
     40   // Returns true if the profile at the given index is currently running any
     41   // background apps.
     42   virtual bool GetBackgroundStatusOfProfileAtIndex(
     43       size_t index) const = 0;
     44 
     45   virtual base::string16 GetGAIANameOfProfileAtIndex(size_t index) const = 0;
     46 
     47   virtual base::string16 GetGAIAGivenNameOfProfileAtIndex(
     48       size_t index) const = 0;
     49 
     50   // Checks if the GAIA name should be used as the profile's name.
     51   virtual bool IsUsingGAIANameOfProfileAtIndex(size_t index) const = 0;
     52 
     53   virtual const gfx::Image* GetGAIAPictureOfProfileAtIndex(
     54       size_t index) const = 0;
     55 
     56   // Checks if the GAIA picture should be used as the profile's avatar icon.
     57   virtual bool IsUsingGAIAPictureOfProfileAtIndex(size_t index) const = 0;
     58 
     59   virtual bool ProfileIsManagedAtIndex(size_t index) const = 0;
     60 
     61   virtual std::string GetManagedUserIdOfProfileAtIndex(size_t index) const = 0;
     62 
     63   // This profile is associated with an account but has been signed-out.
     64   virtual bool ProfileIsSigninRequiredAtIndex(size_t index) const = 0;
     65 
     66   // Profile is known to be ephemeral and should be deleted when closed.
     67   virtual bool ProfileIsEphemeralAtIndex(size_t index) const = 0;
     68 
     69  protected:
     70   virtual ~ProfileInfoInterface() {}
     71 };
     72 
     73 #endif  // CHROME_BROWSER_PROFILES_PROFILE_INFO_INTERFACE_H_
     74