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

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

Issue 2392693002: Rewrite simple uses of base::ListValue::Append(base::Value*) on CrOS. (Closed)
Patch Set: MakeUnique Created 4 years, 2 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 <utility>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 11 #include "base/command_line.h"
10 #include "base/metrics/histogram_macros.h" 12 #include "base/metrics/histogram_macros.h"
11 #include "base/path_service.h" 13 #include "base/path_service.h"
12 #include "base/strings/string_util.h" 14 #include "base/strings/string_util.h"
13 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
14 #include "base/values.h" 16 #include "base/values.h"
15 #include "chrome/browser/chrome_notification_types.h" 17 #include "chrome/browser/chrome_notification_types.h"
16 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" 18 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 new base::DictionaryValue); 174 new base::DictionaryValue);
173 image_data->SetString("url", default_user_image::GetDefaultImageUrl(i)); 175 image_data->SetString("url", default_user_image::GetDefaultImageUrl(i));
174 image_data->SetString("author", 176 image_data->SetString("author",
175 l10n_util::GetStringUTF16( 177 l10n_util::GetStringUTF16(
176 default_user_image::kDefaultImageAuthorIDs[i])); 178 default_user_image::kDefaultImageAuthorIDs[i]));
177 image_data->SetString("website", 179 image_data->SetString("website",
178 l10n_util::GetStringUTF16( 180 l10n_util::GetStringUTF16(
179 default_user_image::kDefaultImageWebsiteIDs[i])); 181 default_user_image::kDefaultImageWebsiteIDs[i]));
180 image_data->SetString("title", 182 image_data->SetString("title",
181 default_user_image::GetDefaultImageDescription(i)); 183 default_user_image::GetDefaultImageDescription(i));
182 image_urls.Append(image_data.release()); 184 image_urls.Append(std::move(image_data));
183 } 185 }
184 web_ui()->CallJavascriptFunctionUnsafe( 186 web_ui()->CallJavascriptFunctionUnsafe(
185 "ChangePictureOptions.setDefaultImages", image_urls); 187 "ChangePictureOptions.setDefaultImages", image_urls);
186 } 188 }
187 189
188 void ChangePictureOptionsHandler::HandleChooseFile( 190 void ChangePictureOptionsHandler::HandleChooseFile(
189 const base::ListValue* args) { 191 const base::ListValue* args) {
190 DCHECK(args && args->empty()); 192 DCHECK(args && args->empty());
191 select_file_dialog_ = ui::SelectFileDialog::Create( 193 select_file_dialog_ = ui::SelectFileDialog::Create(
192 this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); 194 this, new ChromeSelectFilePolicy(web_ui()->GetWebContents()));
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 Profile* profile = Profile::FromWebUI(web_ui()); 472 Profile* profile = Profile::FromWebUI(web_ui());
471 const user_manager::User* user = 473 const user_manager::User* user =
472 ProfileHelper::Get()->GetUserByProfile(profile); 474 ProfileHelper::Get()->GetUserByProfile(profile);
473 if (!user) 475 if (!user)
474 return user_manager::UserManager::Get()->GetActiveUser(); 476 return user_manager::UserManager::Get()->GetActiveUser();
475 return user; 477 return user;
476 } 478 }
477 479
478 } // namespace options 480 } // namespace options
479 } // namespace chromeos 481 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698