| 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 13 matching lines...) Expand all Loading... |
| 24 #include "chrome/browser/profiles/profile_shortcut_manager.h" | 24 #include "chrome/browser/profiles/profile_shortcut_manager.h" |
| 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/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
| 33 #include "chrome/common/pref_names.h" | 33 #include "chrome/common/pref_names.h" |
| 34 #include "chrome/common/profile_management_switches.h" |
| 34 #include "chrome/common/url_constants.h" | 35 #include "chrome/common/url_constants.h" |
| 35 #include "components/signin/core/browser/signin_manager.h" | 36 #include "components/signin/core/browser/signin_manager.h" |
| 36 #include "content/public/browser/browser_thread.h" | 37 #include "content/public/browser/browser_thread.h" |
| 37 #include "content/public/browser/notification_service.h" | 38 #include "content/public/browser/notification_service.h" |
| 38 #include "content/public/browser/web_ui.h" | 39 #include "content/public/browser/web_ui.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 |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 if (icon_url == gaia_picture_url_) { | 317 if (icon_url == gaia_picture_url_) { |
| 317 cache.SetIsUsingGAIAPictureOfProfileAtIndex(profile_index, true); | 318 cache.SetIsUsingGAIAPictureOfProfileAtIndex(profile_index, true); |
| 318 if (!previously_using_gaia_icon) { | 319 if (!previously_using_gaia_icon) { |
| 319 // Only log if they changed to the GAIA photo. | 320 // Only log if they changed to the GAIA photo. |
| 320 // Selection of GAIA photo as avatar is logged as part of the function | 321 // Selection of GAIA photo as avatar is logged as part of the function |
| 321 // below. | 322 // below. |
| 322 ProfileMetrics::LogProfileSwitchGaia(ProfileMetrics::GAIA_OPT_IN); | 323 ProfileMetrics::LogProfileSwitchGaia(ProfileMetrics::GAIA_OPT_IN); |
| 323 } | 324 } |
| 324 } else if (profiles::IsDefaultAvatarIconUrl(icon_url, &new_icon_index)) { | 325 } else if (profiles::IsDefaultAvatarIconUrl(icon_url, &new_icon_index)) { |
| 325 ProfileMetrics::LogProfileAvatarSelection(new_icon_index); | 326 ProfileMetrics::LogProfileAvatarSelection(new_icon_index); |
| 327 |
| 328 if (switches::IsNewProfileManagement()) { |
| 329 profiles::DownloadHighResAvatarIfNeeded(new_icon_index); |
| 330 } |
| 331 |
| 326 PrefService* pref_service = profile->GetPrefs(); | 332 PrefService* pref_service = profile->GetPrefs(); |
| 327 // Updating the profile preference will cause the cache to be updated for | 333 // Updating the profile preference will cause the cache to be updated for |
| 328 // this preference. | 334 // this preference. |
| 329 pref_service->SetInteger(prefs::kProfileAvatarIndex, new_icon_index); | 335 pref_service->SetInteger(prefs::kProfileAvatarIndex, new_icon_index); |
| 330 cache.SetIsUsingGAIAPictureOfProfileAtIndex(profile_index, false); | 336 cache.SetIsUsingGAIAPictureOfProfileAtIndex(profile_index, false); |
| 331 } | 337 } |
| 332 ProfileMetrics::LogProfileUpdate(profile_file_path); | 338 ProfileMetrics::LogProfileUpdate(profile_file_path); |
| 333 | 339 |
| 334 if (profile->IsManaged()) | 340 if (profile->IsManaged()) |
| 335 return; | 341 return; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 g_browser_process->profile_manager()->profile_shortcut_manager(); | 491 g_browser_process->profile_manager()->profile_shortcut_manager(); |
| 486 DCHECK(shortcut_manager); | 492 DCHECK(shortcut_manager); |
| 487 | 493 |
| 488 shortcut_manager->RemoveProfileShortcuts(profile_file_path); | 494 shortcut_manager->RemoveProfileShortcuts(profile_file_path); |
| 489 | 495 |
| 490 // Update the UI buttons. | 496 // Update the UI buttons. |
| 491 OnHasProfileShortcuts(false); | 497 OnHasProfileShortcuts(false); |
| 492 } | 498 } |
| 493 | 499 |
| 494 } // namespace options | 500 } // namespace options |
| OLD | NEW |