Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/change_picture_options_handler.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698