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

Side by Side Diff: chrome/browser/profiles/profile_attributes_entry.h

Issue 1415223002: Add counts of User data to ProfileInfoCache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bug fix. Removed a non-trivial style fix (will upload in another CL). Created 5 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_attributes_entry.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_ATTRIBUTES_ENTRY_H_ 5 #ifndef CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_ENTRY_H_
6 #define CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_ENTRY_H_ 6 #define CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_ENTRY_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 bool IsAuthenticated() const; 77 bool IsAuthenticated() const;
78 // Returns true if the Profile is using the default avatar, which is one of 78 // Returns true if the Profile is using the default avatar, which is one of
79 // the profile icons selectable at profile creation. 79 // the profile icons selectable at profile creation.
80 bool IsUsingDefaultAvatar() const; 80 bool IsUsingDefaultAvatar() const;
81 // Returns true if the profile is signed in but is in an authentication error 81 // Returns true if the profile is signed in but is in an authentication error
82 // state. 82 // state.
83 bool IsAuthError() const; 83 bool IsAuthError() const;
84 // Returns the index of the default icon used by the profile. 84 // Returns the index of the default icon used by the profile.
85 size_t GetAvatarIconIndex() const; 85 size_t GetAvatarIconIndex() const;
86 86
87 // Browsing statistics of the profile.
88 bool HasStatsBrowsingHistory() const;
89 int GetStatsBrowsingHistory() const;
90 bool HasStatsPasswords() const;
91 int GetStatsPasswords() const;
92 bool HasStatsBookmarks() const;
93 int GetStatsBookmarks() const;
94 bool HasStatsSettings() const;
95 int GetStatsSettings() const;
96
87 void SetName(const base::string16& name); 97 void SetName(const base::string16& name);
88 void SetShortcutName(const base::string16& name); 98 void SetShortcutName(const base::string16& name);
89 void SetIsOmitted(bool is_omitted); 99 void SetIsOmitted(bool is_omitted);
90 void SetSupervisedUserId(const std::string& id); 100 void SetSupervisedUserId(const std::string& id);
91 void SetLocalAuthCredentials(const std::string& auth); 101 void SetLocalAuthCredentials(const std::string& auth);
92 void SetPasswordChangeDetectionToken(const std::string& token); 102 void SetPasswordChangeDetectionToken(const std::string& token);
93 void SetBackgroundStatus(bool running_background_apps); 103 void SetBackgroundStatus(bool running_background_apps);
94 void SetGAIAName(const base::string16& name); 104 void SetGAIAName(const base::string16& name);
95 void SetGAIAGivenName(const base::string16& name); 105 void SetGAIAGivenName(const base::string16& name);
96 void SetGAIAPicture(const gfx::Image* image); 106 void SetGAIAPicture(const gfx::Image* image);
97 void SetIsUsingGAIAPicture(bool value); 107 void SetIsUsingGAIAPicture(bool value);
98 void SetIsSigninRequired(bool value); 108 void SetIsSigninRequired(bool value);
99 void SetIsEphemeral(bool value); 109 void SetIsEphemeral(bool value);
100 void SetIsUsingDefaultName(bool value); 110 void SetIsUsingDefaultName(bool value);
101 void SetIsUsingDefaultAvatar(bool value); 111 void SetIsUsingDefaultAvatar(bool value);
102 void SetIsAuthError(bool value); 112 void SetIsAuthError(bool value);
103 void SetAvatarIconIndex(size_t icon_index); 113 void SetAvatarIconIndex(size_t icon_index);
104 114
115 // Get the statistics of the profile.
116 void SetStatsBrowsingHistory(int value);
117 void SetStatsPasswords(int value);
118 void SetStatsBookmarks(int value);
119 void SetStatsSettings(int value);
120
105 void SetAuthInfo(const std::string& gaia_id, 121 void SetAuthInfo(const std::string& gaia_id,
106 const base::string16& user_name); 122 const base::string16& user_name);
107 123
108 private: 124 private:
109 // These members are an implementation detail meant to smooth the migration 125 // These members are an implementation detail meant to smooth the migration
110 // of the ProfileInfoCache to the ProfileAttributesStorage interface. They can 126 // of the ProfileInfoCache to the ProfileAttributesStorage interface. They can
111 // be safely removed once the ProfileInfoCache stops using indices 127 // be safely removed once the ProfileInfoCache stops using indices
112 // internally. 128 // internally.
113 // TODO(anthonyvd): Remove ProfileInfoCache related implementation details 129 // TODO(anthonyvd): Remove ProfileInfoCache related implementation details
114 // when this class holds the members required to fulfill its own contract. 130 // when this class holds the members required to fulfill its own contract.
115 friend class ProfileInfoCache; 131 friend class ProfileInfoCache;
116 void Initialize(ProfileInfoCache* cache, const base::FilePath& path); 132 void Initialize(ProfileInfoCache* cache, const base::FilePath& path);
117 size_t profile_index() const; 133 size_t profile_index() const;
118 ProfileInfoCache* profile_info_cache_; 134 ProfileInfoCache* profile_info_cache_;
119 base::FilePath profile_path_; 135 base::FilePath profile_path_;
120 136
121 DISALLOW_COPY_AND_ASSIGN(ProfileAttributesEntry); 137 DISALLOW_COPY_AND_ASSIGN(ProfileAttributesEntry);
122 }; 138 };
123 139
124 #endif // CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_ENTRY_H_ 140 #endif // CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_ENTRY_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_attributes_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698