Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / webui / options / manage_profile_handler.cc
index f93d09c..16a3005 100644 (file)
@@ -34,6 +34,7 @@
 #include "chrome/grit/generated_resources.h"
 #include "chrome/grit/google_chrome_strings.h"
 #include "components/signin/core/browser/signin_manager.h"
+#include "components/signin/core/common/profile_management_switches.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/notification_service.h"
 #include "content/public/browser/web_ui.h"
@@ -120,6 +121,8 @@ void ManageProfileHandler::GetLocalizedValues(
   RegisterTitle(localized_strings, "manageProfile", IDS_PROFILES_MANAGE_TITLE);
   RegisterTitle(localized_strings, "createProfile", IDS_PROFILES_CREATE_TITLE);
 
+  localized_strings->SetBoolean("newAvatarMenuEnabled",
+                                switches::IsNewAvatarMenu());
   localized_strings->SetBoolean("profileShortcutsEnabled",
                                 ProfileShortcutManager::IsFeatureEnabled());
 
@@ -359,6 +362,9 @@ void ManageProfileHandler::SetProfileIconAndName(const base::ListValue* args) {
     pref_service->SetInteger(prefs::kProfileAvatarIndex, new_icon_index);
     pref_service->SetBoolean(prefs::kProfileUsingDefaultAvatar, false);
     pref_service->SetBoolean(prefs::kProfileUsingGAIAAvatar, false);
+  } else {
+    // Only default avatars and Gaia account photos are supported.
+    CHECK(false);
   }
   ProfileMetrics::LogProfileUpdate(profile_file_path);
 
@@ -530,7 +536,7 @@ void ManageProfileHandler::RemoveProfileShortcut(const base::ListValue* args) {
 }
 
 void ManageProfileHandler::RefreshGaiaPicture(const base::ListValue* args) {
-  profiles::UpdateGaiaProfilePhotoIfNeeded(Profile::FromWebUI(web_ui()));
+  profiles::UpdateGaiaProfileInfoIfNeeded(Profile::FromWebUI(web_ui()));
 }
 
 }  // namespace options