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

Unified Diff: chrome/browser/profiles/profile_attributes_entry.cc

Issue 1214483002: Improve the ProfileInfoCache API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review feedback Created 5 years, 6 months 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/profiles/profile_attributes_entry.cc
diff --git a/chrome/browser/profiles/profile_attributes_entry.cc b/chrome/browser/profiles/profile_attributes_entry.cc
new file mode 100644
index 0000000000000000000000000000000000000000..eac8235013bc7957542f83169e36fad158baa3b5
--- /dev/null
+++ b/chrome/browser/profiles/profile_attributes_entry.cc
@@ -0,0 +1,207 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/profiles/profile_attributes_entry.h"
+#include "chrome/browser/profiles/profile_info_cache.h"
+
+ProfileAttributesEntry::ProfileAttributesEntry()
+ : ProfileAttributesEntry(nullptr, std::string::npos) {}
+
+ProfileAttributesEntry::ProfileAttributesEntry(
+ ProfileInfoCache* cache, size_t index)
+ : profile_info_cache_(cache),
+ profile_index_(index) {}
+
+base::string16 ProfileAttributesEntry::GetName() const {
+ return profile_info_cache_->GetNameOfProfileAtIndex(profile_index_);
+}
+
+base::string16 ProfileAttributesEntry::GetShortcutName() const {
+ return profile_info_cache_->GetShortcutNameOfProfileAtIndex(profile_index_);
+}
+
+base::FilePath ProfileAttributesEntry::GetPath() const {
+ return profile_info_cache_->GetPathOfProfileAtIndex(profile_index_);
+}
+
+base::Time ProfileAttributesEntry::GetActiveTime() const {
+ return profile_info_cache_->GetProfileActiveTimeAtIndex(profile_index_);
+}
+
+base::string16 ProfileAttributesEntry::GetUserName() const {
+ return profile_info_cache_->GetUserNameOfProfileAtIndex(profile_index_);
+}
+
+const gfx::Image& ProfileAttributesEntry::GetAvatarIcon() {
+ return profile_info_cache_->GetAvatarIconOfProfileAtIndex(profile_index_);
+}
+
+std::string ProfileAttributesEntry::GetLocalAuthCredentials() const {
+ return profile_info_cache_->GetLocalAuthCredentialsOfProfileAtIndex(
+ profile_index_);
+}
+
+std::string ProfileAttributesEntry::GetPasswordChangeDetectionToken() const {
+ return profile_info_cache_->GetPasswordChangeDetectionTokenAtIndex(
+ profile_index_);
+}
+
+bool ProfileAttributesEntry::GetBackgroundStatus() const {
+ return profile_info_cache_->GetBackgroundStatusOfProfileAtIndex(
+ profile_index_);
+}
+
+base::string16 ProfileAttributesEntry::GetGAIAName() const {
+ return profile_info_cache_->GetGAIANameOfProfileAtIndex(profile_index_);
+}
+
+base::string16 ProfileAttributesEntry::GetGAIAGivenName() const {
+ return profile_info_cache_->GetGAIAGivenNameOfProfileAtIndex(profile_index_);
+}
+
+std::string ProfileAttributesEntry::GetGAIAId() const {
+ return profile_info_cache_->GetGAIAIdOfProfileAtIndex(profile_index_);
+}
+
+const gfx::Image* ProfileAttributesEntry::GetGAIAPicture() const {
+ return profile_info_cache_->GetGAIAPictureOfProfileAtIndex(profile_index_);
+}
+
+bool ProfileAttributesEntry::IsUsingGAIAPicture() const {
+ return profile_info_cache_->IsUsingGAIAPictureOfProfileAtIndex(
+ profile_index_);
+}
+
+bool ProfileAttributesEntry::IsSupervised() const {
+ return profile_info_cache_->ProfileIsSupervisedAtIndex(profile_index_);
+}
+
+bool ProfileAttributesEntry::IsChild() const {
+ return profile_info_cache_->ProfileIsChildAtIndex(profile_index_);
+}
+
+bool ProfileAttributesEntry::IsLegacySupervised() const {
+ return profile_info_cache_->ProfileIsLegacySupervisedAtIndex(profile_index_);
+}
+
+bool ProfileAttributesEntry::IsOmitted() const {
+ return profile_info_cache_->IsOmittedProfileAtIndex(profile_index_);
+}
+
+bool ProfileAttributesEntry::IsSigninRequired() const {
+ return profile_info_cache_->ProfileIsSigninRequiredAtIndex(profile_index_);
+}
+
+std::string ProfileAttributesEntry::GetSupervisedUserId() const {
+ return profile_info_cache_->GetSupervisedUserIdOfProfileAtIndex(
+ profile_index_);
+}
+
+bool ProfileAttributesEntry::IsEphemeral() const {
+ return profile_info_cache_->ProfileIsEphemeralAtIndex(profile_index_);
+}
+
+bool ProfileAttributesEntry::IsUsingDefaultName() const {
+ return profile_info_cache_->ProfileIsUsingDefaultNameAtIndex(profile_index_);
+}
+
+bool ProfileAttributesEntry::IsAuthenticated() const {
+ return profile_info_cache_->ProfileIsAuthenticatedAtIndex(profile_index_);
+}
+
+bool ProfileAttributesEntry::IsUsingDefaultAvatar() const {
+ return profile_info_cache_->ProfileIsUsingDefaultAvatarAtIndex(
+ profile_index_);
+}
+
+bool ProfileAttributesEntry::IsAuthError() const {
+ return profile_info_cache_->ProfileIsAuthErrorAtIndex(profile_index_);
+}
+
+size_t ProfileAttributesEntry::GetAvatarIconIndex() const {
+ return profile_info_cache_->GetAvatarIconIndexOfProfileAtIndex(
+ profile_index_);
+}
+
+void ProfileAttributesEntry::SetName(const base::string16& name) {
+ profile_info_cache_->SetNameOfProfileAtIndex(profile_index_, name);
+}
+
+void ProfileAttributesEntry::SetShortcutName(const base::string16& name) {
+ profile_info_cache_->SetShortcutNameOfProfileAtIndex(profile_index_, name);
+}
+
+void ProfileAttributesEntry::SetIsOmitted(bool is_omitted) {
+ profile_info_cache_->SetIsOmittedProfileAtIndex(profile_index_, is_omitted);
+}
+
+void ProfileAttributesEntry::SetSupervisedUserId(const std::string& id) {
+ profile_info_cache_->SetSupervisedUserIdOfProfileAtIndex(profile_index_, id);
+}
+
+void ProfileAttributesEntry::SetLocalAuthCredentials(const std::string& auth) {
+ profile_info_cache_->SetLocalAuthCredentialsOfProfileAtIndex(
+ profile_index_, auth);
+}
+
+void ProfileAttributesEntry::SetPasswordChangeDetectionToken(
+ const std::string& token) {
+ profile_info_cache_->SetPasswordChangeDetectionTokenAtIndex(
+ profile_index_, token);
+}
+
+void ProfileAttributesEntry::SetBackgroundStatus(bool running_background_apps) {
+ profile_info_cache_->SetBackgroundStatusOfProfileAtIndex(
+ profile_index_, running_background_apps);
+}
+
+void ProfileAttributesEntry::SetGAIAName(const base::string16& name) {
+ profile_info_cache_->SetGAIANameOfProfileAtIndex(profile_index_, name);
+}
+
+void ProfileAttributesEntry::SetGAIAGivenName(const base::string16& name) {
+ profile_info_cache_->SetGAIAGivenNameOfProfileAtIndex(profile_index_, name);
+}
+
+void ProfileAttributesEntry::SetGAIAPicture(const gfx::Image* image) {
+ profile_info_cache_->SetGAIAPictureOfProfileAtIndex(profile_index_, image);
+}
+
+void ProfileAttributesEntry::SetIsUsingGAIAPicture(bool value) {
+ profile_info_cache_->SetIsUsingGAIAPictureOfProfileAtIndex(
+ profile_index_, value);
+}
+
+void ProfileAttributesEntry::SetIsSigninRequired(bool value) {
+ profile_info_cache_->SetProfileSigninRequiredAtIndex(profile_index_, value);
+}
+
+void ProfileAttributesEntry::SetIsEphemeral(bool value) {
+ profile_info_cache_->SetProfileIsEphemeralAtIndex(profile_index_, value);
+}
+
+void ProfileAttributesEntry::SetIsUsingDefaultName(bool value) {
+ profile_info_cache_->SetProfileIsUsingDefaultNameAtIndex(
+ profile_index_, value);
+}
+
+void ProfileAttributesEntry::SetIsUsingDefaultAvatar(bool value) {
+ profile_info_cache_->SetProfileIsUsingDefaultAvatarAtIndex(
+ profile_index_, value);
+}
+
+void ProfileAttributesEntry::SetIsAuthError(bool value) {
+ profile_info_cache_->SetProfileIsAuthErrorAtIndex(profile_index_, value);
+}
+
+void ProfileAttributesEntry::SetAvatarIconIndex(size_t icon_index) {
+ profile_info_cache_->SetAvatarIconOfProfileAtIndex(
+ profile_index_, icon_index);
+}
+
+void ProfileAttributesEntry::SetAuthInfo(
+ const std::string& gaia_id, const base::string16& user_name) {
+ profile_info_cache_->SetAuthInfoOfProfileAtIndex(
+ profile_index_, gaia_id, user_name);
+}

Powered by Google App Engine
This is Rietveld 408576698