Don't show supervised user as "already on this device" while they're being imported.
[chromium-blink-merge.git] / chrome / browser / ui / webui / options / manage_profile_handler.cc
blobac857391b06abc4e3e7c2d51b20719219140cd9d
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/webui/options/manage_profile_handler.h"
7 #include "base/bind.h"
8 #include "base/bind_helpers.h"
9 #include "base/prefs/pref_service.h"
10 #include "base/prefs/scoped_user_pref_update.h"
11 #include "base/strings/string_number_conversions.h"
12 #include "base/strings/string_util.h"
13 #include "base/strings/utf_string_conversions.h"
14 #include "base/value_conversions.h"
15 #include "base/values.h"
16 #include "chrome/browser/browser_process.h"
17 #include "chrome/browser/chrome_notification_types.h"
18 #include "chrome/browser/profiles/gaia_info_update_service.h"
19 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/browser/profiles/profile_avatar_icon_util.h"
21 #include "chrome/browser/profiles/profile_info_cache.h"
22 #include "chrome/browser/profiles/profile_manager.h"
23 #include "chrome/browser/profiles/profile_metrics.h"
24 #include "chrome/browser/profiles/profile_shortcut_manager.h"
25 #include "chrome/browser/profiles/profile_window.h"
26 #include "chrome/browser/profiles/profiles_state.h"
27 #include "chrome/browser/signin/signin_manager_factory.h"
28 #include "chrome/browser/sync/profile_sync_service.h"
29 #include "chrome/browser/sync/profile_sync_service_factory.h"
30 #include "chrome/browser/ui/browser_finder.h"
31 #include "chrome/browser/ui/webui/options/options_handlers_helper.h"
32 #include "chrome/common/pref_names.h"
33 #include "chrome/common/url_constants.h"
34 #include "chrome/grit/chromium_strings.h"
35 #include "chrome/grit/generated_resources.h"
36 #include "components/signin/core/browser/signin_manager.h"
37 #include "components/signin/core/common/profile_management_switches.h"
38 #include "content/public/browser/browser_thread.h"
39 #include "content/public/browser/notification_service.h"
40 #include "content/public/browser/web_ui.h"
41 #include "google_apis/gaia/gaia_auth_util.h"
42 #include "ui/base/l10n/l10n_util.h"
43 #include "ui/base/webui/web_ui_util.h"
45 #if defined(ENABLE_SETTINGS_APP)
46 #include "chrome/browser/ui/app_list/app_list_service.h"
47 #include "content/public/browser/web_contents.h"
48 #endif
50 namespace options {
52 namespace {
54 const char kCreateProfileIdentifier[] = "create";
55 const char kManageProfileIdentifier[] = "manage";
57 // Given |args| from the WebUI, parses value 0 as a FilePath |profile_file_path|
58 // and returns true on success.
59 bool GetProfilePathFromArgs(const base::ListValue* args,
60 base::FilePath* profile_file_path) {
61 const base::Value* file_path_value;
62 if (!args->Get(0, &file_path_value))
63 return false;
64 return base::GetValueAsFilePath(*file_path_value, profile_file_path);
67 void HandleLogDeleteUserDialogShown(const base::ListValue* args) {
68 ProfileMetrics::LogProfileDeleteUser(
69 ProfileMetrics::DELETE_PROFILE_SETTINGS_SHOW_WARNING);
72 } // namespace
74 ManageProfileHandler::ManageProfileHandler()
75 : weak_factory_(this) {
78 ManageProfileHandler::~ManageProfileHandler() {
79 ProfileSyncService* service =
80 ProfileSyncServiceFactory::GetForProfile(Profile::FromWebUI(web_ui()));
81 // Sync may be disabled in tests.
82 if (service)
83 service->RemoveObserver(this);
86 void ManageProfileHandler::GetLocalizedValues(
87 base::DictionaryValue* localized_strings) {
88 DCHECK(localized_strings);
90 static OptionsStringResource resources[] = {
91 { "manageProfilesNameLabel", IDS_PROFILES_MANAGE_NAME_LABEL },
92 { "manageProfilesIconLabel", IDS_PROFILES_MANAGE_ICON_LABEL },
93 { "manageProfilesExistingSupervisedUser",
94 IDS_PROFILES_CREATE_EXISTING_SUPERVISED_USER_ERROR },
95 { "manageProfilesSupervisedSignedInLabel",
96 IDS_PROFILES_CREATE_SUPERVISED_SIGNED_IN_LABEL },
97 { "manageProfilesSupervisedNotSignedIn",
98 IDS_PROFILES_CREATE_SUPERVISED_NOT_SIGNED_IN_HTML },
99 { "manageProfilesSupervisedAccountDetailsOutOfDate",
100 IDS_PROFILES_CREATE_SUPERVISED_ACCOUNT_DETAILS_OUT_OF_DATE_LABEL },
101 { "manageProfilesSupervisedSignInAgainLink",
102 IDS_PROFILES_CREATE_SUPERVISED_SIGN_IN_AGAIN_LINK },
103 { "manageProfilesConfirm", IDS_SAVE },
104 { "deleteProfileTitle", IDS_PROFILES_DELETE_TITLE },
105 { "deleteProfileOK", IDS_PROFILES_DELETE_OK_BUTTON_LABEL },
106 { "deleteProfileMessage", IDS_PROFILES_DELETE_MESSAGE },
107 { "deleteSupervisedProfileAddendum",
108 IDS_PROFILES_DELETE_SUPERVISED_ADDENDUM },
109 { "disconnectManagedProfileTitle",
110 IDS_PROFILES_DISCONNECT_MANAGED_PROFILE_TITLE },
111 { "disconnectManagedProfileOK",
112 IDS_PROFILES_DISCONNECT_MANAGED_PROFILE_OK_BUTTON_LABEL },
113 { "createProfileTitle", IDS_PROFILES_CREATE_TITLE },
114 { "createProfileInstructions", IDS_PROFILES_CREATE_INSTRUCTIONS },
115 { "createProfileConfirm", IDS_ADD },
116 { "createProfileShortcutCheckbox", IDS_PROFILES_CREATE_SHORTCUT_CHECKBOX },
117 { "createProfileShortcutButton", IDS_PROFILES_CREATE_SHORTCUT_BUTTON },
118 { "removeProfileShortcutButton", IDS_PROFILES_REMOVE_SHORTCUT_BUTTON },
119 { "importExistingSupervisedUserLink",
120 IDS_PROFILES_IMPORT_EXISTING_SUPERVISED_USER_LINK },
123 RegisterStrings(localized_strings, resources, arraysize(resources));
124 RegisterTitle(localized_strings, "manageProfile", IDS_PROFILES_MANAGE_TITLE);
125 RegisterTitle(localized_strings, "createProfile", IDS_PROFILES_CREATE_TITLE);
127 localized_strings->SetBoolean("newAvatarMenuEnabled",
128 switches::IsNewAvatarMenu());
129 localized_strings->SetBoolean("profileShortcutsEnabled",
130 ProfileShortcutManager::IsFeatureEnabled());
132 GenerateSignedinUserSpecificStrings(localized_strings);
135 void ManageProfileHandler::InitializeHandler() {
136 g_browser_process->profile_manager()->GetProfileInfoCache().AddObserver(this);
138 Profile* profile = Profile::FromWebUI(web_ui());
139 pref_change_registrar_.Init(profile->GetPrefs());
140 pref_change_registrar_.Add(
141 prefs::kSupervisedUserCreationAllowed,
142 base::Bind(&ManageProfileHandler::OnCreateSupervisedUserPrefChange,
143 base::Unretained(this)));
144 ProfileSyncService* service =
145 ProfileSyncServiceFactory::GetForProfile(profile);
146 // Sync may be disabled for tests.
147 if (service)
148 service->AddObserver(this);
151 void ManageProfileHandler::InitializePage() {
152 SendExistingProfileNames();
153 OnCreateSupervisedUserPrefChange();
156 void ManageProfileHandler::RegisterMessages() {
157 web_ui()->RegisterMessageCallback("setProfileIconAndName",
158 base::Bind(&ManageProfileHandler::SetProfileIconAndName,
159 base::Unretained(this)));
160 web_ui()->RegisterMessageCallback("requestDefaultProfileIcons",
161 base::Bind(&ManageProfileHandler::RequestDefaultProfileIcons,
162 base::Unretained(this)));
163 web_ui()->RegisterMessageCallback("requestNewProfileDefaults",
164 base::Bind(&ManageProfileHandler::RequestNewProfileDefaults,
165 base::Unretained(this)));
166 web_ui()->RegisterMessageCallback("requestHasProfileShortcuts",
167 base::Bind(&ManageProfileHandler::RequestHasProfileShortcuts,
168 base::Unretained(this)));
169 web_ui()->RegisterMessageCallback("requestCreateProfileUpdate",
170 base::Bind(&ManageProfileHandler::RequestCreateProfileUpdate,
171 base::Unretained(this)));
172 web_ui()->RegisterMessageCallback("profileIconSelectionChanged",
173 base::Bind(&ManageProfileHandler::ProfileIconSelectionChanged,
174 base::Unretained(this)));
175 #if defined(ENABLE_SETTINGS_APP)
176 web_ui()->RegisterMessageCallback("switchAppListProfile",
177 base::Bind(&ManageProfileHandler::SwitchAppListProfile,
178 base::Unretained(this)));
179 #endif
180 web_ui()->RegisterMessageCallback("addProfileShortcut",
181 base::Bind(&ManageProfileHandler::AddProfileShortcut,
182 base::Unretained(this)));
183 web_ui()->RegisterMessageCallback("removeProfileShortcut",
184 base::Bind(&ManageProfileHandler::RemoveProfileShortcut,
185 base::Unretained(this)));
186 web_ui()->RegisterMessageCallback("refreshGaiaPicture",
187 base::Bind(&ManageProfileHandler::RefreshGaiaPicture,
188 base::Unretained(this)));
189 web_ui()->RegisterMessageCallback(
190 "showDisconnectManagedProfileDialog",
191 base::Bind(&ManageProfileHandler::ShowDisconnectManagedProfileDialog,
192 base::Unretained(this)));
193 web_ui()->RegisterMessageCallback("logDeleteUserDialogShown",
194 base::Bind(&HandleLogDeleteUserDialogShown));
197 void ManageProfileHandler::Uninitialize() {
198 g_browser_process->profile_manager()->
199 GetProfileInfoCache().RemoveObserver(this);
202 void ManageProfileHandler::OnProfileAdded(const base::FilePath& profile_path) {
203 SendExistingProfileNames();
206 void ManageProfileHandler::OnProfileWasRemoved(
207 const base::FilePath& profile_path,
208 const base::string16& profile_name) {
209 SendExistingProfileNames();
212 void ManageProfileHandler::OnProfileNameChanged(
213 const base::FilePath& profile_path,
214 const base::string16& old_profile_name) {
215 base::StringValue value(kManageProfileIdentifier);
216 SendProfileIconsAndNames(value);
219 void ManageProfileHandler::OnProfileAvatarChanged(
220 const base::FilePath& profile_path) {
221 base::StringValue value(kManageProfileIdentifier);
222 SendProfileIconsAndNames(value);
225 void ManageProfileHandler::OnStateChanged() {
226 RequestCreateProfileUpdate(NULL);
229 void ManageProfileHandler::GenerateSignedinUserSpecificStrings(
230 base::DictionaryValue* dictionary) {
231 std::string username;
232 std::string domain_name;
234 #if !defined(OS_CHROMEOS)
235 Profile* profile = Profile::FromWebUI(web_ui());
236 DCHECK(profile);
237 SigninManagerBase* manager = SigninManagerFactory::GetForProfile(profile);
238 if (manager) {
239 username = manager->GetAuthenticatedUsername();
240 // If there is no one logged in or if the profile name is empty then the
241 // domain name is empty. This happens in browser tests.
242 if (!username.empty()) {
243 domain_name = "<span id=disconnect-managed-profile-domain-name>" +
244 gaia::ExtractDomainName(username) + "</span>";
247 #endif
249 dictionary->SetString(
250 "disconnectManagedProfileDomainInformation",
251 l10n_util::GetStringFUTF16(
252 IDS_PROFILES_DISCONNECT_MANAGED_PROFILE_DOMAIN_INFORMATION,
253 base::ASCIIToUTF16(domain_name)));
255 dictionary->SetString(
256 "disconnectManagedProfileText",
257 l10n_util::GetStringFUTF16(
258 IDS_PROFILES_DISCONNECT_MANAGED_PROFILE_TEXT,
259 base::UTF8ToUTF16(username),
260 base::UTF8ToUTF16(chrome::kSyncGoogleDashboardURL)));
263 void ManageProfileHandler::RequestDefaultProfileIcons(
264 const base::ListValue* args) {
265 std::string mode;
266 bool ok = args->GetString(0, &mode);
267 DCHECK(ok);
268 DCHECK(mode == kCreateProfileIdentifier || mode == kManageProfileIdentifier);
269 if (ok) {
270 base::StringValue value(mode);
271 SendProfileIconsAndNames(value);
275 void ManageProfileHandler::RequestNewProfileDefaults(
276 const base::ListValue* args) {
277 const ProfileInfoCache& cache =
278 g_browser_process->profile_manager()->GetProfileInfoCache();
279 const size_t icon_index = cache.ChooseAvatarIconIndexForNewProfile();
281 base::DictionaryValue profile_info;
282 profile_info.SetString("name", cache.ChooseNameForNewProfile(icon_index));
283 profile_info.SetString("iconURL",
284 profiles::GetDefaultAvatarIconUrl(icon_index));
286 web_ui()->CallJavascriptFunction(
287 "ManageProfileOverlay.receiveNewProfileDefaults", profile_info);
290 void ManageProfileHandler::SendProfileIconsAndNames(
291 const base::StringValue& mode) {
292 base::ListValue image_url_list;
293 base::ListValue default_name_list;
295 // First add the GAIA picture if it's available.
296 const ProfileInfoCache& cache =
297 g_browser_process->profile_manager()->GetProfileInfoCache();
298 Profile* profile = Profile::FromWebUI(web_ui());
299 size_t profile_index = cache.GetIndexOfProfileWithPath(profile->GetPath());
300 if (profile_index != std::string::npos) {
301 const gfx::Image* icon =
302 cache.GetGAIAPictureOfProfileAtIndex(profile_index);
303 if (icon) {
304 gfx::Image icon2 = profiles::GetAvatarIconForWebUI(*icon, true);
305 gaia_picture_url_ = webui::GetBitmapDataUrl(icon2.AsBitmap());
306 image_url_list.AppendString(gaia_picture_url_);
307 default_name_list.AppendString(std::string());
311 // Next add the default avatar icons and names.
312 for (size_t i = 0; i < profiles::GetDefaultAvatarIconCount(); i++) {
313 std::string url = profiles::GetDefaultAvatarIconUrl(i);
314 image_url_list.AppendString(url);
315 default_name_list.AppendString(cache.ChooseNameForNewProfile(i));
318 web_ui()->CallJavascriptFunction(
319 "ManageProfileOverlay.receiveDefaultProfileIconsAndNames", mode,
320 image_url_list, default_name_list);
323 void ManageProfileHandler::SendExistingProfileNames() {
324 const ProfileInfoCache& cache =
325 g_browser_process->profile_manager()->GetProfileInfoCache();
326 base::DictionaryValue profile_name_dict;
327 for (size_t i = 0, e = cache.GetNumberOfProfiles(); i < e; ++i) {
328 profile_name_dict.SetBoolean(
329 base::UTF16ToUTF8(cache.GetNameOfProfileAtIndex(i)), true);
332 web_ui()->CallJavascriptFunction(
333 "ManageProfileOverlay.receiveExistingProfileNames", profile_name_dict);
336 void ManageProfileHandler::ShowDisconnectManagedProfileDialog(
337 const base::ListValue* args) {
338 base::DictionaryValue replacements;
339 GenerateSignedinUserSpecificStrings(&replacements);
340 web_ui()->CallJavascriptFunction(
341 "ManageProfileOverlay.showDisconnectManagedProfileDialog", replacements);
344 void ManageProfileHandler::SetProfileIconAndName(const base::ListValue* args) {
345 DCHECK(args);
347 base::FilePath profile_file_path;
348 if (!GetProfilePathFromArgs(args, &profile_file_path))
349 return;
351 Profile* profile =
352 g_browser_process->profile_manager()->GetProfile(profile_file_path);
353 if (!profile)
354 return;
356 std::string icon_url;
357 if (!args->GetString(1, &icon_url))
358 return;
360 PrefService* pref_service = profile->GetPrefs();
361 // Updating the profile preferences will cause the cache to be updated.
363 // Metrics logging variable.
364 bool previously_using_gaia_icon =
365 pref_service->GetBoolean(prefs::kProfileUsingGAIAAvatar);
367 size_t new_icon_index;
368 if (icon_url == gaia_picture_url_) {
369 pref_service->SetBoolean(prefs::kProfileUsingDefaultAvatar, false);
370 pref_service->SetBoolean(prefs::kProfileUsingGAIAAvatar, true);
371 if (!previously_using_gaia_icon) {
372 // Only log if they changed to the GAIA photo.
373 // Selection of GAIA photo as avatar is logged as part of the function
374 // below.
375 ProfileMetrics::LogProfileSwitchGaia(ProfileMetrics::GAIA_OPT_IN);
377 } else if (profiles::IsDefaultAvatarIconUrl(icon_url, &new_icon_index)) {
378 ProfileMetrics::LogProfileAvatarSelection(new_icon_index);
379 pref_service->SetInteger(prefs::kProfileAvatarIndex, new_icon_index);
380 pref_service->SetBoolean(prefs::kProfileUsingDefaultAvatar, false);
381 pref_service->SetBoolean(prefs::kProfileUsingGAIAAvatar, false);
382 } else {
383 // Only default avatars and Gaia account photos are supported.
384 CHECK(false);
386 ProfileMetrics::LogProfileUpdate(profile_file_path);
388 if (profile->IsLegacySupervised())
389 return;
391 base::string16 new_profile_name;
392 if (!args->GetString(2, &new_profile_name))
393 return;
395 base::TrimWhitespace(new_profile_name, base::TRIM_ALL, &new_profile_name);
396 CHECK(!new_profile_name.empty());
397 profiles::UpdateProfileName(profile, new_profile_name);
400 #if defined(ENABLE_SETTINGS_APP)
401 void ManageProfileHandler::SwitchAppListProfile(const base::ListValue* args) {
402 DCHECK(args);
403 DCHECK(profiles::IsMultipleProfilesEnabled());
405 const base::Value* file_path_value;
406 base::FilePath profile_file_path;
407 if (!args->Get(0, &file_path_value) ||
408 !base::GetValueAsFilePath(*file_path_value, &profile_file_path))
409 return;
411 AppListService* app_list_service = AppListService::Get(
412 options::helper::GetDesktopType(web_ui()));
413 app_list_service->SetProfilePath(profile_file_path);
414 app_list_service->Show();
416 // Close the settings app, since it will now be for the wrong profile.
417 web_ui()->GetWebContents()->Close();
419 #endif // defined(ENABLE_SETTINGS_APP)
421 void ManageProfileHandler::ProfileIconSelectionChanged(
422 const base::ListValue* args) {
423 DCHECK(args);
425 base::FilePath profile_file_path;
426 if (!GetProfilePathFromArgs(args, &profile_file_path))
427 return;
429 // Currently this only supports editing the current profile's info.
430 if (profile_file_path != Profile::FromWebUI(web_ui())->GetPath())
431 return;
433 std::string icon_url;
434 if (!args->GetString(1, &icon_url))
435 return;
437 if (icon_url != gaia_picture_url_)
438 return;
440 // If the selection is the GAIA picture then also show the profile name in the
441 // text field. This will display either the GAIA given name, if available,
442 // or the first name.
443 ProfileInfoCache& cache =
444 g_browser_process->profile_manager()->GetProfileInfoCache();
445 size_t profile_index = cache.GetIndexOfProfileWithPath(profile_file_path);
446 if (profile_index == std::string::npos)
447 return;
448 base::string16 gaia_name = cache.GetNameOfProfileAtIndex(profile_index);
449 if (gaia_name.empty())
450 return;
452 base::StringValue gaia_name_value(gaia_name);
453 base::StringValue mode_value(kManageProfileIdentifier);
454 web_ui()->CallJavascriptFunction("ManageProfileOverlay.setProfileName",
455 gaia_name_value, mode_value);
458 void ManageProfileHandler::RequestHasProfileShortcuts(
459 const base::ListValue* args) {
460 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
461 DCHECK(ProfileShortcutManager::IsFeatureEnabled());
463 base::FilePath profile_file_path;
464 if (!GetProfilePathFromArgs(args, &profile_file_path))
465 return;
467 const ProfileInfoCache& cache =
468 g_browser_process->profile_manager()->GetProfileInfoCache();
469 size_t profile_index = cache.GetIndexOfProfileWithPath(profile_file_path);
470 if (profile_index == std::string::npos)
471 return;
473 // Don't show the add/remove desktop shortcut button in the single user case.
474 if (cache.GetNumberOfProfiles() <= 1)
475 return;
477 const base::FilePath profile_path =
478 cache.GetPathOfProfileAtIndex(profile_index);
479 ProfileShortcutManager* shortcut_manager =
480 g_browser_process->profile_manager()->profile_shortcut_manager();
481 shortcut_manager->HasProfileShortcuts(
482 profile_path, base::Bind(&ManageProfileHandler::OnHasProfileShortcuts,
483 weak_factory_.GetWeakPtr()));
486 void ManageProfileHandler::RequestCreateProfileUpdate(
487 const base::ListValue* args) {
488 Profile* profile = Profile::FromWebUI(web_ui());
489 SigninManagerBase* manager =
490 SigninManagerFactory::GetForProfile(profile);
491 base::string16 username =
492 base::UTF8ToUTF16(manager->GetAuthenticatedUsername());
493 ProfileSyncService* service =
494 ProfileSyncServiceFactory::GetForProfile(profile);
495 GoogleServiceAuthError::State state = GoogleServiceAuthError::NONE;
497 // |service| might be null if Sync is disabled from the command line.
498 if (service)
499 state = service->GetAuthError().state();
501 bool has_error = (!service ||
502 state == GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS ||
503 state == GoogleServiceAuthError::USER_NOT_SIGNED_UP ||
504 state == GoogleServiceAuthError::ACCOUNT_DELETED ||
505 state == GoogleServiceAuthError::ACCOUNT_DISABLED);
506 web_ui()->CallJavascriptFunction("CreateProfileOverlay.updateSignedInStatus",
507 base::StringValue(username),
508 base::FundamentalValue(has_error));
510 OnCreateSupervisedUserPrefChange();
513 void ManageProfileHandler::OnCreateSupervisedUserPrefChange() {
514 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs();
515 base::FundamentalValue allowed(
516 prefs->GetBoolean(prefs::kSupervisedUserCreationAllowed));
517 web_ui()->CallJavascriptFunction(
518 "CreateProfileOverlay.updateSupervisedUsersAllowed", allowed);
521 void ManageProfileHandler::OnHasProfileShortcuts(bool has_shortcuts) {
522 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
524 const base::FundamentalValue has_shortcuts_value(has_shortcuts);
525 web_ui()->CallJavascriptFunction(
526 "ManageProfileOverlay.receiveHasProfileShortcuts", has_shortcuts_value);
529 void ManageProfileHandler::AddProfileShortcut(const base::ListValue* args) {
530 base::FilePath profile_file_path;
531 if (!GetProfilePathFromArgs(args, &profile_file_path))
532 return;
534 DCHECK(ProfileShortcutManager::IsFeatureEnabled());
535 ProfileShortcutManager* shortcut_manager =
536 g_browser_process->profile_manager()->profile_shortcut_manager();
537 DCHECK(shortcut_manager);
539 shortcut_manager->CreateProfileShortcut(profile_file_path);
541 // Update the UI buttons.
542 OnHasProfileShortcuts(true);
545 void ManageProfileHandler::RemoveProfileShortcut(const base::ListValue* args) {
546 base::FilePath profile_file_path;
547 if (!GetProfilePathFromArgs(args, &profile_file_path))
548 return;
550 DCHECK(ProfileShortcutManager::IsFeatureEnabled());
551 ProfileShortcutManager* shortcut_manager =
552 g_browser_process->profile_manager()->profile_shortcut_manager();
553 DCHECK(shortcut_manager);
555 shortcut_manager->RemoveProfileShortcuts(profile_file_path);
557 // Update the UI buttons.
558 OnHasProfileShortcuts(false);
561 void ManageProfileHandler::RefreshGaiaPicture(const base::ListValue* args) {
562 profiles::UpdateGaiaProfileInfoIfNeeded(Profile::FromWebUI(web_ui()));
565 } // namespace options