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

Unified Diff: chrome/browser/profiles/profile_info_util.h

Issue 8539043: Refactor ProfileInfoCache (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/profiles/profile_info_interface.h ('k') | chrome/browser/profiles/profile_info_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_info_util.h
diff --git a/chrome/browser/profiles/profile_info_util.h b/chrome/browser/profiles/profile_info_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..fb328e96586e11d83e014691615b73d58b7f662f
--- /dev/null
+++ b/chrome/browser/profiles/profile_info_util.h
@@ -0,0 +1,44 @@
+// Copyright (c) 2011 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_UTIL_H_
+#define CHROME_BROWSER_PROFILES_PROFILE_INFO_UTIL_H_
+#pragma once
+
+#include <string>
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/string16.h"
+#include "chrome/browser/profiles/profile_info_entry.h"
+
+namespace profiles {
+
+// Gets the number of default avatar icons that exist.
+size_t GetDefaultAvatarIconCount();
+
+// Gets the resource ID of the default avatar icon at |index|.
+int GetDefaultAvatarIconResourceIDAtIndex(size_t index);
+
+// Returns a URL for the default avatar icon with specified index.
+std::string GetDefaultAvatarIconUrl(size_t index);
+
+// Checks if the given URL points to one of the default avatar icons. If it
+// is, returns true and its index through |icon_index|. If not, returns false.
+bool IsDefaultAvatarIconUrl(const std::string& icon_url, size_t *icon_index);
+
+// Returns unique name that can be assigned to a newly created profile.
+// The name is based on the given icon.
+string16 ChooseNameForNewProfile(const std::vector<ProfileInfoEntry>& entries,
+ size_t icon_index);
+
+// Returns an avatar icon index that can be assigned to a newly created
+// profile. Note that the icon may not be unique since there are a limited
+// set of default icons.
+size_t ChooseAvatarIconIndexForNewProfile(
+ const std::vector<ProfileInfoEntry>& entries);
+
+} // namespace profiles
+
+#endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_UTIL_H_
« no previous file with comments | « chrome/browser/profiles/profile_info_interface.h ('k') | chrome/browser/profiles/profile_info_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698