OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/settings/chromeos/change_picture_handler.h" | 5 #include "chrome/browser/ui/webui/settings/chromeos/change_picture_handler.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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 base::Unretained(this))); | 116 base::Unretained(this))); |
117 web_ui()->RegisterMessageCallback( | 117 web_ui()->RegisterMessageCallback( |
118 "selectImage", base::Bind(&ChangePictureHandler::HandleSelectImage, | 118 "selectImage", base::Bind(&ChangePictureHandler::HandleSelectImage, |
119 base::Unretained(this))); | 119 base::Unretained(this))); |
120 } | 120 } |
121 | 121 |
122 void ChangePictureHandler::SendDefaultImages() { | 122 void ChangePictureHandler::SendDefaultImages() { |
123 base::ListValue image_urls; | 123 base::ListValue image_urls; |
124 for (int i = default_user_image::kFirstDefaultImageIndex; | 124 for (int i = default_user_image::kFirstDefaultImageIndex; |
125 i < default_user_image::kDefaultImagesCount; ++i) { | 125 i < default_user_image::kDefaultImagesCount; ++i) { |
126 scoped_ptr<base::DictionaryValue> image_data(new base::DictionaryValue); | 126 std::unique_ptr<base::DictionaryValue> image_data( |
| 127 new base::DictionaryValue); |
127 image_data->SetString("url", default_user_image::GetDefaultImageUrl(i)); | 128 image_data->SetString("url", default_user_image::GetDefaultImageUrl(i)); |
128 image_data->SetString("author", | 129 image_data->SetString("author", |
129 l10n_util::GetStringUTF16( | 130 l10n_util::GetStringUTF16( |
130 default_user_image::kDefaultImageAuthorIDs[i])); | 131 default_user_image::kDefaultImageAuthorIDs[i])); |
131 image_data->SetString("website", | 132 image_data->SetString("website", |
132 l10n_util::GetStringUTF16( | 133 l10n_util::GetStringUTF16( |
133 default_user_image::kDefaultImageWebsiteIDs[i])); | 134 default_user_image::kDefaultImageWebsiteIDs[i])); |
134 image_data->SetString("title", | 135 image_data->SetString("title", |
135 default_user_image::GetDefaultImageDescription(i)); | 136 default_user_image::GetDefaultImageDescription(i)); |
136 image_urls.Append(image_data.release()); | 137 image_urls.Append(image_data.release()); |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 Profile* profile = Profile::FromWebUI(web_ui()); | 401 Profile* profile = Profile::FromWebUI(web_ui()); |
401 const user_manager::User* user = | 402 const user_manager::User* user = |
402 ProfileHelper::Get()->GetUserByProfile(profile); | 403 ProfileHelper::Get()->GetUserByProfile(profile); |
403 if (!user) | 404 if (!user) |
404 return user_manager::UserManager::Get()->GetActiveUser(); | 405 return user_manager::UserManager::Get()->GetActiveUser(); |
405 return user; | 406 return user; |
406 } | 407 } |
407 | 408 |
408 } // namespace settings | 409 } // namespace settings |
409 } // namespace chromeos | 410 } // namespace chromeos |
OLD | NEW |