Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 194 // Only log if they changed to the GAIA photo. | 194 // Only log if they changed to the GAIA photo. |
| 195 // Selection of GAIA photo as avatar is logged as part of the function | 195 // Selection of GAIA photo as avatar is logged as part of the function |
| 196 // below. | 196 // below. |
| 197 ProfileMetrics::LogProfileSwitchGaia(ProfileMetrics::GAIA_OPT_IN); | 197 ProfileMetrics::LogProfileSwitchGaia(ProfileMetrics::GAIA_OPT_IN); |
| 198 } | 198 } |
| 199 } else if (cache.IsDefaultAvatarIconUrl(icon_url, &new_icon_index)) { | 199 } else if (cache.IsDefaultAvatarIconUrl(icon_url, &new_icon_index)) { |
| 200 PrefService* pref_service = profile->GetPrefs(); | 200 PrefService* pref_service = profile->GetPrefs(); |
| 201 ProfileMetrics::LogProfileAvatarSelection(new_icon_index); | 201 ProfileMetrics::LogProfileAvatarSelection(new_icon_index); |
| 202 // Updating the profile preference will cause the cache to be updated for | 202 // Updating the profile preference will cause the cache to be updated for |
| 203 // this preference. | 203 // this preference. |
| 204 cache.SetIsUsingGAIAPictureOfProfileAtIndex(profile_index, false); | |
| 204 pref_service->SetInteger(prefs::kProfileAvatarIndex, new_icon_index); | 205 pref_service->SetInteger(prefs::kProfileAvatarIndex, new_icon_index); |
|
SteveT
2011/12/22 02:59:07
I had to make this switch because SetInteger(kProf
sail
2011/12/22 04:03:11
But wouldn't it eventually become correct once Set
SteveT
2011/12/22 04:36:24
Hm... So SetIsUsingGAIAPictureOfProfileAtIndex cur
sail
2011/12/22 04:48:28
Really? That's weird. Similar to the name function
sail
2011/12/22 04:48:28
Sounds good. I'm not worried about the actual orde
| |
| 205 cache.SetIsUsingGAIAPictureOfProfileAtIndex(profile_index, false); | |
| 206 } | 206 } |
| 207 | 207 |
| 208 ProfileMetrics::LogProfileUpdate(profile_file_path); | 208 ProfileMetrics::LogProfileUpdate(profile_file_path); |
| 209 } | 209 } |
| 210 | 210 |
| 211 void ManageProfileHandler::DeleteProfile(const ListValue* args) { | 211 void ManageProfileHandler::DeleteProfile(const ListValue* args) { |
| 212 DCHECK(args); | 212 DCHECK(args); |
| 213 | 213 |
| 214 ProfileMetrics::LogProfileDeleteUser(ProfileMetrics::PROFILE_DELETED); | 214 ProfileMetrics::LogProfileDeleteUser(ProfileMetrics::PROFILE_DELETED); |
| 215 | 215 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 303 if (i == std::string::npos) | 303 if (i == std::string::npos) |
| 304 return; | 304 return; |
| 305 string16 gaia_name = cache.GetGAIANameOfProfileAtIndex(i); | 305 string16 gaia_name = cache.GetGAIANameOfProfileAtIndex(i); |
| 306 if (gaia_name.empty()) | 306 if (gaia_name.empty()) |
| 307 return; | 307 return; |
| 308 | 308 |
| 309 StringValue gaia_name_value(gaia_name); | 309 StringValue gaia_name_value(gaia_name); |
| 310 web_ui_->CallJavascriptFunction("ManageProfileOverlay.setProfileName", | 310 web_ui_->CallJavascriptFunction("ManageProfileOverlay.setProfileName", |
| 311 gaia_name_value); | 311 gaia_name_value); |
| 312 } | 312 } |
| OLD | NEW |