| 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/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/prefs/scoped_user_pref_update.h" | 10 #include "base/prefs/scoped_user_pref_update.h" |
| (...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 // Only log if they changed to the GAIA photo. | 352 // Only log if they changed to the GAIA photo. |
| 353 // Selection of GAIA photo as avatar is logged as part of the function | 353 // Selection of GAIA photo as avatar is logged as part of the function |
| 354 // below. | 354 // below. |
| 355 ProfileMetrics::LogProfileSwitchGaia(ProfileMetrics::GAIA_OPT_IN); | 355 ProfileMetrics::LogProfileSwitchGaia(ProfileMetrics::GAIA_OPT_IN); |
| 356 } | 356 } |
| 357 } else if (profiles::IsDefaultAvatarIconUrl(icon_url, &new_icon_index)) { | 357 } else if (profiles::IsDefaultAvatarIconUrl(icon_url, &new_icon_index)) { |
| 358 ProfileMetrics::LogProfileAvatarSelection(new_icon_index); | 358 ProfileMetrics::LogProfileAvatarSelection(new_icon_index); |
| 359 pref_service->SetInteger(prefs::kProfileAvatarIndex, new_icon_index); | 359 pref_service->SetInteger(prefs::kProfileAvatarIndex, new_icon_index); |
| 360 pref_service->SetBoolean(prefs::kProfileUsingDefaultAvatar, false); | 360 pref_service->SetBoolean(prefs::kProfileUsingDefaultAvatar, false); |
| 361 pref_service->SetBoolean(prefs::kProfileUsingGAIAAvatar, false); | 361 pref_service->SetBoolean(prefs::kProfileUsingGAIAAvatar, false); |
| 362 } else { |
| 363 // Only default avatars and Gaia account photos are supported. |
| 364 CHECK(false); |
| 362 } | 365 } |
| 363 ProfileMetrics::LogProfileUpdate(profile_file_path); | 366 ProfileMetrics::LogProfileUpdate(profile_file_path); |
| 364 | 367 |
| 365 if (profile->IsSupervised()) | 368 if (profile->IsSupervised()) |
| 366 return; | 369 return; |
| 367 | 370 |
| 368 base::string16 new_profile_name; | 371 base::string16 new_profile_name; |
| 369 if (!args->GetString(2, &new_profile_name)) | 372 if (!args->GetString(2, &new_profile_name)) |
| 370 return; | 373 return; |
| 371 | 374 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 | 530 |
| 528 // Update the UI buttons. | 531 // Update the UI buttons. |
| 529 OnHasProfileShortcuts(false); | 532 OnHasProfileShortcuts(false); |
| 530 } | 533 } |
| 531 | 534 |
| 532 void ManageProfileHandler::RefreshGaiaPicture(const base::ListValue* args) { | 535 void ManageProfileHandler::RefreshGaiaPicture(const base::ListValue* args) { |
| 533 profiles::UpdateGaiaProfileInfoIfNeeded(Profile::FromWebUI(web_ui())); | 536 profiles::UpdateGaiaProfileInfoIfNeeded(Profile::FromWebUI(web_ui())); |
| 534 } | 537 } |
| 535 | 538 |
| 536 } // namespace options | 539 } // namespace options |
| OLD | NEW |