OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/webui/options/manage_profile_handler.h" | 5 #include "chrome/browser/ui/webui/options/manage_profile_handler.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 14 matching lines...) Expand all Loading... | |
25 #include "chrome/browser/profiles/profile_window.h" | 25 #include "chrome/browser/profiles/profile_window.h" |
26 #include "chrome/browser/profiles/profiles_state.h" | 26 #include "chrome/browser/profiles/profiles_state.h" |
27 #include "chrome/browser/signin/signin_manager_factory.h" | 27 #include "chrome/browser/signin/signin_manager_factory.h" |
28 #include "chrome/browser/sync/profile_sync_service.h" | 28 #include "chrome/browser/sync/profile_sync_service.h" |
29 #include "chrome/browser/sync/profile_sync_service_factory.h" | 29 #include "chrome/browser/sync/profile_sync_service_factory.h" |
30 #include "chrome/browser/ui/browser_finder.h" | 30 #include "chrome/browser/ui/browser_finder.h" |
31 #include "chrome/browser/ui/webui/options/options_handlers_helper.h" | 31 #include "chrome/browser/ui/webui/options/options_handlers_helper.h" |
32 #include "chrome/common/pref_names.h" | 32 #include "chrome/common/pref_names.h" |
33 #include "chrome/common/url_constants.h" | 33 #include "chrome/common/url_constants.h" |
34 #include "components/signin/core/browser/signin_manager.h" | 34 #include "components/signin/core/browser/signin_manager.h" |
35 #include "components/signin/core/common/profile_management_switches.h" | |
35 #include "content/public/browser/browser_thread.h" | 36 #include "content/public/browser/browser_thread.h" |
36 #include "content/public/browser/notification_service.h" | 37 #include "content/public/browser/notification_service.h" |
37 #include "content/public/browser/web_ui.h" | 38 #include "content/public/browser/web_ui.h" |
38 #include "google_apis/gaia/gaia_auth_util.h" | 39 #include "google_apis/gaia/gaia_auth_util.h" |
39 #include "grit/generated_resources.h" | 40 #include "grit/generated_resources.h" |
40 #include "grit/google_chrome_strings.h" | 41 #include "grit/google_chrome_strings.h" |
41 #include "ui/base/l10n/l10n_util.h" | 42 #include "ui/base/l10n/l10n_util.h" |
42 #include "ui/base/webui/web_ui_util.h" | 43 #include "ui/base/webui/web_ui_util.h" |
43 | 44 |
44 #if defined(ENABLE_SETTINGS_APP) | 45 #if defined(ENABLE_SETTINGS_APP) |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
341 if (icon_url == gaia_picture_url_) { | 342 if (icon_url == gaia_picture_url_) { |
342 cache.SetIsUsingGAIAPictureOfProfileAtIndex(profile_index, true); | 343 cache.SetIsUsingGAIAPictureOfProfileAtIndex(profile_index, true); |
343 if (!previously_using_gaia_icon) { | 344 if (!previously_using_gaia_icon) { |
344 // Only log if they changed to the GAIA photo. | 345 // Only log if they changed to the GAIA photo. |
345 // Selection of GAIA photo as avatar is logged as part of the function | 346 // Selection of GAIA photo as avatar is logged as part of the function |
346 // below. | 347 // below. |
347 ProfileMetrics::LogProfileSwitchGaia(ProfileMetrics::GAIA_OPT_IN); | 348 ProfileMetrics::LogProfileSwitchGaia(ProfileMetrics::GAIA_OPT_IN); |
348 } | 349 } |
349 } else if (profiles::IsDefaultAvatarIconUrl(icon_url, &new_icon_index)) { | 350 } else if (profiles::IsDefaultAvatarIconUrl(icon_url, &new_icon_index)) { |
350 ProfileMetrics::LogProfileAvatarSelection(new_icon_index); | 351 ProfileMetrics::LogProfileAvatarSelection(new_icon_index); |
352 | |
353 if (switches::IsNewAvatarMenu()) { | |
msw
2014/04/28 20:46:37
nit: drop unnecessary braces.
noms (inactive)
2014/04/29 19:12:27
Done.
| |
354 profiles::DownloadHighResAvatarIfNeeded(new_icon_index); | |
355 } | |
356 | |
351 PrefService* pref_service = profile->GetPrefs(); | 357 PrefService* pref_service = profile->GetPrefs(); |
352 // Updating the profile preference will cause the cache to be updated for | 358 // Updating the profile preference will cause the cache to be updated for |
353 // this preference. | 359 // this preference. |
354 pref_service->SetInteger(prefs::kProfileAvatarIndex, new_icon_index); | 360 pref_service->SetInteger(prefs::kProfileAvatarIndex, new_icon_index); |
355 cache.SetIsUsingGAIAPictureOfProfileAtIndex(profile_index, false); | 361 cache.SetIsUsingGAIAPictureOfProfileAtIndex(profile_index, false); |
356 } | 362 } |
357 ProfileMetrics::LogProfileUpdate(profile_file_path); | 363 ProfileMetrics::LogProfileUpdate(profile_file_path); |
358 | 364 |
359 if (profile->IsManaged()) | 365 if (profile->IsManaged()) |
360 return; | 366 return; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
515 g_browser_process->profile_manager()->profile_shortcut_manager(); | 521 g_browser_process->profile_manager()->profile_shortcut_manager(); |
516 DCHECK(shortcut_manager); | 522 DCHECK(shortcut_manager); |
517 | 523 |
518 shortcut_manager->RemoveProfileShortcuts(profile_file_path); | 524 shortcut_manager->RemoveProfileShortcuts(profile_file_path); |
519 | 525 |
520 // Update the UI buttons. | 526 // Update the UI buttons. |
521 OnHasProfileShortcuts(false); | 527 OnHasProfileShortcuts(false); |
522 } | 528 } |
523 | 529 |
524 } // namespace options | 530 } // namespace options |
OLD | NEW |