| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ |
| 6 #define CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // This class saves various information about profiles to local preferences. | 29 // This class saves various information about profiles to local preferences. |
| 30 // This cache can be used to display a list of profiles without having to | 30 // This cache can be used to display a list of profiles without having to |
| 31 // actually load the profiles from disk. | 31 // actually load the profiles from disk. |
| 32 class ProfileInfoCache : public ProfileInfoInterface { | 32 class ProfileInfoCache : public ProfileInfoInterface { |
| 33 public: | 33 public: |
| 34 ProfileInfoCache(PrefService* prefs, const FilePath& user_data_dir); | 34 ProfileInfoCache(PrefService* prefs, const FilePath& user_data_dir); |
| 35 virtual ~ProfileInfoCache(); | 35 virtual ~ProfileInfoCache(); |
| 36 | 36 |
| 37 void AddProfileToCache(const FilePath& profile_path, | 37 void AddProfileToCache(const FilePath& profile_path, |
| 38 const string16& name, | 38 const string16& name, |
| 39 const string16& username, |
| 39 size_t icon_index); | 40 size_t icon_index); |
| 40 void DeleteProfileFromCache(const FilePath& profile_path); | 41 void DeleteProfileFromCache(const FilePath& profile_path); |
| 41 | 42 |
| 42 // ProfileInfoInterface: | 43 // ProfileInfoInterface: |
| 43 virtual size_t GetNumberOfProfiles() const OVERRIDE; | 44 virtual size_t GetNumberOfProfiles() const OVERRIDE; |
| 44 virtual size_t GetIndexOfProfileWithPath( | 45 virtual size_t GetIndexOfProfileWithPath( |
| 45 const FilePath& profile_path) const OVERRIDE; | 46 const FilePath& profile_path) const OVERRIDE; |
| 46 virtual string16 GetNameOfProfileAtIndex(size_t index) const OVERRIDE; | 47 virtual string16 GetNameOfProfileAtIndex(size_t index) const OVERRIDE; |
| 47 virtual FilePath GetPathOfProfileAtIndex(size_t index) const OVERRIDE; | 48 virtual FilePath GetPathOfProfileAtIndex(size_t index) const OVERRIDE; |
| 48 virtual string16 GetUserNameOfProfileAtIndex(size_t index) const OVERRIDE; | 49 virtual string16 GetUserNameOfProfileAtIndex(size_t index) const OVERRIDE; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 const string16& search_name); | 92 const string16& search_name); |
| 92 | 93 |
| 93 PrefService* prefs_; | 94 PrefService* prefs_; |
| 94 std::vector<std::string> sorted_keys_; | 95 std::vector<std::string> sorted_keys_; |
| 95 FilePath user_data_dir_; | 96 FilePath user_data_dir_; |
| 96 | 97 |
| 97 DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache); | 98 DISALLOW_COPY_AND_ASSIGN(ProfileInfoCache); |
| 98 }; | 99 }; |
| 99 | 100 |
| 100 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ | 101 #endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_H_ |
| OLD | NEW |