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

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: Added methods in profile_statistics.cc to access ProfileInfoCache, fixed a few style errors 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
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 <map>
lwchkg 2015/11/18 17:34:53 Unnecessary. Now removed.
8 #include <string> 9 #include <string>
9 10
10 #include "base/files/file_path.h" 11 #include "base/files/file_path.h"
11 #include "base/strings/string16.h" 12 #include "base/strings/string16.h"
12 #include "base/time/time.h" 13 #include "base/time/time.h"
13 14
14 namespace gfx { 15 namespace gfx {
15 class Image; 16 class Image;
16 } 17 }
17 18
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 bool IsAuthenticated() const; 78 bool IsAuthenticated() const;
78 // Returns true if the Profile is using the default avatar, which is one of 79 // Returns true if the Profile is using the default avatar, which is one of
79 // the profile icons selectable at profile creation. 80 // the profile icons selectable at profile creation.
80 bool IsUsingDefaultAvatar() const; 81 bool IsUsingDefaultAvatar() const;
81 // Returns true if the profile is signed in but is in an authentication error 82 // Returns true if the profile is signed in but is in an authentication error
82 // state. 83 // state.
83 bool IsAuthError() const; 84 bool IsAuthError() const;
84 // Returns the index of the default icon used by the profile. 85 // Returns the index of the default icon used by the profile.
85 size_t GetAvatarIconIndex() const; 86 size_t GetAvatarIconIndex() const;
86 87
88 // Get the statistics of the profiles
Mike Lerman 2015/11/17 16:29:51 Browsing statistics of the profile.
lwchkg 2015/11/18 17:34:53 Done.
89 bool HasStatsBrowsingHistory() const;
90 int GetStatsBrowsingHistory() const;
91 bool HasStatsPasswords() const;
92 int GetStatsPasswords() const;
93 bool HasStatsBookmarks() const;
94 int GetStatsBookmarks() const;
95 bool HasStatsSettings() const;
96 int GetStatsSettings() const;
97
87 void SetName(const base::string16& name); 98 void SetName(const base::string16& name);
88 void SetShortcutName(const base::string16& name); 99 void SetShortcutName(const base::string16& name);
89 void SetIsOmitted(bool is_omitted); 100 void SetIsOmitted(bool is_omitted);
90 void SetSupervisedUserId(const std::string& id); 101 void SetSupervisedUserId(const std::string& id);
91 void SetLocalAuthCredentials(const std::string& auth); 102 void SetLocalAuthCredentials(const std::string& auth);
92 void SetPasswordChangeDetectionToken(const std::string& token); 103 void SetPasswordChangeDetectionToken(const std::string& token);
93 void SetBackgroundStatus(bool running_background_apps); 104 void SetBackgroundStatus(bool running_background_apps);
94 void SetGAIAName(const base::string16& name); 105 void SetGAIAName(const base::string16& name);
95 void SetGAIAGivenName(const base::string16& name); 106 void SetGAIAGivenName(const base::string16& name);
96 void SetGAIAPicture(const gfx::Image* image); 107 void SetGAIAPicture(const gfx::Image* image);
97 void SetIsUsingGAIAPicture(bool value); 108 void SetIsUsingGAIAPicture(bool value);
98 void SetIsSigninRequired(bool value); 109 void SetIsSigninRequired(bool value);
99 void SetIsEphemeral(bool value); 110 void SetIsEphemeral(bool value);
100 void SetIsUsingDefaultName(bool value); 111 void SetIsUsingDefaultName(bool value);
101 void SetIsUsingDefaultAvatar(bool value); 112 void SetIsUsingDefaultAvatar(bool value);
102 void SetIsAuthError(bool value); 113 void SetIsAuthError(bool value);
103 void SetAvatarIconIndex(size_t icon_index); 114 void SetAvatarIconIndex(size_t icon_index);
104 115
116 // Set the statistics of the profiles
Mike Lerman 2015/11/17 16:29:51 nit: of the profile. (singular, and add a period)
lwchkg 2015/11/18 17:34:53 Done.
117 void SetStatsBrowsingHistory(int value);
118 void SetStatsPasswords(int value);
119 void SetStatsBookmarks(int value);
120 void SetStatsSettings(int value);
121
105 void SetAuthInfo(const std::string& gaia_id, 122 void SetAuthInfo(const std::string& gaia_id,
106 const base::string16& user_name); 123 const base::string16& user_name);
107 124
108 private: 125 private:
109 // These members are an implementation detail meant to smooth the migration 126 // These members are an implementation detail meant to smooth the migration
110 // of the ProfileInfoCache to the ProfileAttributesStorage interface. They can 127 // of the ProfileInfoCache to the ProfileAttributesStorage interface. They can
111 // be safely removed once the ProfileInfoCache stops using indices 128 // be safely removed once the ProfileInfoCache stops using indices
112 // internally. 129 // internally.
113 // TODO(anthonyvd): Remove ProfileInfoCache related implementation details 130 // TODO(anthonyvd): Remove ProfileInfoCache related implementation details
114 // when this class holds the members required to fulfill its own contract. 131 // when this class holds the members required to fulfill its own contract.
115 friend class ProfileInfoCache; 132 friend class ProfileInfoCache;
116 void Initialize(ProfileInfoCache* cache, const base::FilePath& path); 133 void Initialize(ProfileInfoCache* cache, const base::FilePath& path);
117 size_t profile_index() const; 134 size_t profile_index() const;
118 ProfileInfoCache* profile_info_cache_; 135 ProfileInfoCache* profile_info_cache_;
119 base::FilePath profile_path_; 136 base::FilePath profile_path_;
120 137
121 DISALLOW_COPY_AND_ASSIGN(ProfileAttributesEntry); 138 DISALLOW_COPY_AND_ASSIGN(ProfileAttributesEntry);
122 }; 139 };
123 140
124 #endif // CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_ENTRY_H_ 141 #endif // CHROME_BROWSER_PROFILES_PROFILE_ATTRIBUTES_ENTRY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698