| 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/chromeos/change_picture_options_handle
r.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/change_picture_options_handle
r.h" |
| 6 | 6 |
| 7 #include "ash/audio/sounds.h" | 7 #include "ash/audio/sounds.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 base::Unretained(this))); | 160 base::Unretained(this))); |
| 161 web_ui()->RegisterMessageCallback("selectImage", | 161 web_ui()->RegisterMessageCallback("selectImage", |
| 162 base::Bind(&ChangePictureOptionsHandler::HandleSelectImage, | 162 base::Bind(&ChangePictureOptionsHandler::HandleSelectImage, |
| 163 base::Unretained(this))); | 163 base::Unretained(this))); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void ChangePictureOptionsHandler::SendDefaultImages() { | 166 void ChangePictureOptionsHandler::SendDefaultImages() { |
| 167 base::ListValue image_urls; | 167 base::ListValue image_urls; |
| 168 for (int i = default_user_image::kFirstDefaultImageIndex; | 168 for (int i = default_user_image::kFirstDefaultImageIndex; |
| 169 i < default_user_image::kDefaultImagesCount; ++i) { | 169 i < default_user_image::kDefaultImagesCount; ++i) { |
| 170 scoped_ptr<base::DictionaryValue> image_data(new base::DictionaryValue); | 170 std::unique_ptr<base::DictionaryValue> image_data( |
| 171 new base::DictionaryValue); |
| 171 image_data->SetString("url", default_user_image::GetDefaultImageUrl(i)); | 172 image_data->SetString("url", default_user_image::GetDefaultImageUrl(i)); |
| 172 image_data->SetString("author", | 173 image_data->SetString("author", |
| 173 l10n_util::GetStringUTF16( | 174 l10n_util::GetStringUTF16( |
| 174 default_user_image::kDefaultImageAuthorIDs[i])); | 175 default_user_image::kDefaultImageAuthorIDs[i])); |
| 175 image_data->SetString("website", | 176 image_data->SetString("website", |
| 176 l10n_util::GetStringUTF16( | 177 l10n_util::GetStringUTF16( |
| 177 default_user_image::kDefaultImageWebsiteIDs[i])); | 178 default_user_image::kDefaultImageWebsiteIDs[i])); |
| 178 image_data->SetString("title", | 179 image_data->SetString("title", |
| 179 default_user_image::GetDefaultImageDescription(i)); | 180 default_user_image::GetDefaultImageDescription(i)); |
| 180 image_urls.Append(image_data.release()); | 181 image_urls.Append(image_data.release()); |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 Profile* profile = Profile::FromWebUI(web_ui()); | 466 Profile* profile = Profile::FromWebUI(web_ui()); |
| 466 const user_manager::User* user = | 467 const user_manager::User* user = |
| 467 ProfileHelper::Get()->GetUserByProfile(profile); | 468 ProfileHelper::Get()->GetUserByProfile(profile); |
| 468 if (!user) | 469 if (!user) |
| 469 return user_manager::UserManager::Get()->GetActiveUser(); | 470 return user_manager::UserManager::Get()->GetActiveUser(); |
| 470 return user; | 471 return user; |
| 471 } | 472 } |
| 472 | 473 |
| 473 } // namespace options | 474 } // namespace options |
| 474 } // namespace chromeos | 475 } // namespace chromeos |
| OLD | NEW |