Index: chrome/browser/profiles/profile_info_entry.h |
diff --git a/chrome/browser/profiles/profile_info_entry.h b/chrome/browser/profiles/profile_info_entry.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..63b0e5cff2884eefdffb8e0ed13251ee5922563f |
--- /dev/null |
+++ b/chrome/browser/profiles/profile_info_entry.h |
@@ -0,0 +1,110 @@ |
+// Copyright 2013 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. |
+ |
+#ifndef CHROME_BROWSER_PROFILES_PROFILE_INFO_ENTRY_H_ |
+#define CHROME_BROWSER_PROFILES_PROFILE_INFO_ENTRY_H_ |
+ |
+#include "base/basictypes.h" |
+#include "base/files/file_path.h" |
+#include "chrome/browser/profiles/profile_info_util.h" |
+#include "ui/base/resource/resource_bundle.h" |
+ |
+namespace base { |
+class DictionaryValue; |
+} |
+namespace gfx { |
+class Image; |
+} |
+ |
+// This class caches information about a single profile. |
+class ProfileInfoEntry { |
+ public: |
+ ProfileInfoEntry(); |
+ explicit ProfileInfoEntry(const base::FilePath& path, |
+ const base::DictionaryValue& info); |
+ |
+ // Overload the < and = operators so that the ProfileInfoCache can return |
+ // a list of sorted ProfileInfoEntries. |
+ ProfileInfoEntry& operator=(const ProfileInfoEntry& entry); |
+ bool operator<(const ProfileInfoEntry& rhs) const; |
+ |
+ const base::FilePath& path() const { return path_; } |
+ void set_path(const base::FilePath& path) { path_ = path; } |
+ |
+ const string16& name() const { return name_; } |
+ void set_name(const string16& name) { name_ = name; } |
+ |
+ const string16& shortcut_name() const { return shortcut_name_; } |
+ void set_shortcut_name(const string16& name) {shortcut_name_ = name; } |
+ |
+ const string16& user_name() const { return user_name_; } |
+ void set_user_name(const string16& user_name) { user_name_ = user_name; } |
+ |
+ const string16& GAIA_given_name() const { return GAIA_given_name_; } |
+ void set_GAIA_given_name(const string16& name) { GAIA_given_name_ = name; } |
+ |
+ const string16& GAIA_full_name() const { return GAIA_full_name_; } |
+ void set_GAIA_full_name(const string16& name) { GAIA_full_name_ = name; } |
+ |
+ bool is_using_GAIA_name() const { return is_using_GAIA_name_; } |
+ void set_is_using_GAIA_name(bool flag) { is_using_GAIA_name_ = flag; } |
+ |
+ bool is_using_GAIA_picture() const { return is_using_GAIA_picture_; } |
+ void set_is_using_GAIA_picture(bool flag) { is_using_GAIA_picture_ = flag; } |
+ |
+ bool has_migrated_to_GAIA_info_of_profile() const { return has_migrated_to_GAIA_info_of_profile_; } |
+ void set_has_migrated_to_GAIA_info_of_profile(bool flag) { has_migrated_to_GAIA_info_of_profile_ = flag; } |
+ |
+ const std::string GAIA_picture_file_name() const { return GAIA_picture_file_name_; } |
+ void set_GAIA_picture_file_name(const std::string& file) { GAIA_picture_file_name_ = file; } |
+ |
+ const std::string managed_user_id() const { return managed_user_id_; } |
+ void set_managed_user_id(const std::string& id) { managed_user_id_ = id; } |
+ |
+ size_t icon_index() const { return icon_index_; } |
+ void set_icon_index(size_t index) { icon_index_ = index; } |
+ |
+ bool is_running_background_apps() const { return is_running_background_apps_; } |
+ void set_is_running_background_apps(bool flag) { is_running_background_apps_ = flag; } |
+ |
+ bool is_signin_required() const { return is_signin_required_; } |
+ void set_is_signin_required(bool flag) { is_signin_required_ = flag; } |
+ |
+ // This refers to local management (formerly "managed mode"), |
+ // not enterprise management. |
+ bool IsManaged() const { |
+ return !managed_user_id_.empty(); |
+ } |
+ |
+ const string16 GetDisplayName() const { |
+ string16 name; |
+ if (is_using_GAIA_name_) |
+ name = GAIA_given_name_.empty() ? GAIA_full_name_ : GAIA_given_name_; |
+ |
+ return name.empty() ? name_ : name; |
+ } |
+ |
+ private: |
+ base::FilePath path_; |
+ string16 name_; |
+ string16 shortcut_name_; |
+ string16 user_name_; |
+ |
+ string16 GAIA_given_name_; |
+ string16 GAIA_full_name_; |
+ bool is_using_GAIA_name_; |
+ bool is_using_GAIA_picture_; |
+ std::string GAIA_picture_file_name_; |
+ bool has_migrated_to_GAIA_info_of_profile_; |
+ |
+ // This refers to local management (formerly "managed mode"), |
+ // not enterprise management. |
+ std::string managed_user_id_; |
+ size_t icon_index_; |
+ bool is_running_background_apps_; |
+ |
+ bool is_signin_required_; |
+}; |
+ |
+#endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_ENTRY_H_ |