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

Unified Diff: chrome/browser/ui/webui/options2/manage_profile_handler2.cc

Issue 10689084: Merge 143541 - Fix edit profile link in NTP (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
Patch Set: Created 8 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
« no previous file with comments | « chrome/browser/ui/webui/options2/manage_profile_handler2.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options2/manage_profile_handler2.cc
===================================================================
--- chrome/browser/ui/webui/options2/manage_profile_handler2.cc (revision 145236)
+++ chrome/browser/ui/webui/options2/manage_profile_handler2.cc (working copy)
@@ -71,9 +71,6 @@
web_ui()->RegisterMessageCallback("requestDefaultProfileIcons",
base::Bind(&ManageProfileHandler::RequestDefaultProfileIcons,
base::Unretained(this)));
- web_ui()->RegisterMessageCallback("requestProfileInfo",
- base::Bind(&ManageProfileHandler::RequestProfileInfo,
- base::Unretained(this)));
web_ui()->RegisterMessageCallback("profileIconSelectionChanged",
base::Bind(&ManageProfileHandler::ProfileIconSelectionChanged,
base::Unretained(this)));
@@ -236,57 +233,6 @@
profile_file_path);
}
-void ManageProfileHandler::RequestProfileInfo(const ListValue* args) {
- DCHECK(args);
-
- Value* index_value;
- double index_double;
- if (!args->Get(0, &index_value) || !index_value->GetAsDouble(&index_double))
- return;
-
- int index = static_cast<int>(index_double);
- ProfileInfoCache& cache =
- g_browser_process->profile_manager()->GetProfileInfoCache();
- int profile_count = cache.GetNumberOfProfiles();
- if (index < 0 && index >= profile_count)
- return;
-
- FilePath profile_path = cache.GetPathOfProfileAtIndex(index);
- FilePath current_profile_path = Profile::FromWebUI(web_ui())->GetPath();
- bool is_current_profile =
- profile_path == Profile::FromWebUI(web_ui())->GetPath();
-
- DictionaryValue profile_value;
- profile_value.SetString("name", cache.GetNameOfProfileAtIndex(index));
- profile_value.Set("filePath", base::CreateFilePathValue(profile_path));
- profile_value.SetBoolean("isCurrentProfile", is_current_profile);
-
- bool is_gaia_picture =
- cache.IsUsingGAIAPictureOfProfileAtIndex(index) &&
- cache.GetGAIAPictureOfProfileAtIndex(index);
- if (is_gaia_picture) {
- gfx::Image icon = profiles::GetAvatarIconForWebUI(
- cache.GetAvatarIconOfProfileAtIndex(index), true);
- profile_value.SetString("iconURL",
- web_ui_util::GetImageDataUrl(*icon.ToImageSkia()));
- } else {
- size_t icon_index = cache.GetAvatarIconIndexOfProfileAtIndex(index);
- profile_value.SetString("iconURL",
- cache.GetDefaultAvatarIconUrl(icon_index));
- }
-
- web_ui()->CallJavascriptFunction("ManageProfileOverlay.setProfileInfo",
- profile_value);
-
- // Ensure that we have the most up to date GAIA picture.
- if (is_current_profile) {
- GAIAInfoUpdateService* service =
- Profile::FromWebUI(web_ui())->GetGAIAInfoUpdateService();
- if (service)
- service->Update();
- }
-}
-
void ManageProfileHandler::ProfileIconSelectionChanged(
const base::ListValue* args) {
DCHECK(args);
« no previous file with comments | « chrome/browser/ui/webui/options2/manage_profile_handler2.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698