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 <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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 new base::DictionaryValue); | 136 new base::DictionaryValue); |
135 image_data->SetString("url", default_user_image::GetDefaultImageUrl(i)); | 137 image_data->SetString("url", default_user_image::GetDefaultImageUrl(i)); |
136 image_data->SetString("author", | 138 image_data->SetString("author", |
137 l10n_util::GetStringUTF16( | 139 l10n_util::GetStringUTF16( |
138 default_user_image::kDefaultImageAuthorIDs[i])); | 140 default_user_image::kDefaultImageAuthorIDs[i])); |
139 image_data->SetString("website", | 141 image_data->SetString("website", |
140 l10n_util::GetStringUTF16( | 142 l10n_util::GetStringUTF16( |
141 default_user_image::kDefaultImageWebsiteIDs[i])); | 143 default_user_image::kDefaultImageWebsiteIDs[i])); |
142 image_data->SetString("title", | 144 image_data->SetString("title", |
143 default_user_image::GetDefaultImageDescription(i)); | 145 default_user_image::GetDefaultImageDescription(i)); |
144 image_urls.Append(image_data.release()); | 146 image_urls.Append(std::move(image_data)); |
145 } | 147 } |
146 CallJavascriptFunction("cr.webUIListenerCallback", | 148 CallJavascriptFunction("cr.webUIListenerCallback", |
147 base::StringValue("default-images-changed"), | 149 base::StringValue("default-images-changed"), |
148 image_urls); | 150 image_urls); |
149 } | 151 } |
150 | 152 |
151 void ChangePictureHandler::HandleChooseFile(const base::ListValue* args) { | 153 void ChangePictureHandler::HandleChooseFile(const base::ListValue* args) { |
152 DCHECK(args && args->empty()); | 154 DCHECK(args && args->empty()); |
153 select_file_dialog_ = ui::SelectFileDialog::Create( | 155 select_file_dialog_ = ui::SelectFileDialog::Create( |
154 this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); | 156 this, new ChromeSelectFilePolicy(web_ui()->GetWebContents())); |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 Profile* profile = Profile::FromWebUI(web_ui()); | 414 Profile* profile = Profile::FromWebUI(web_ui()); |
413 const user_manager::User* user = | 415 const user_manager::User* user = |
414 ProfileHelper::Get()->GetUserByProfile(profile); | 416 ProfileHelper::Get()->GetUserByProfile(profile); |
415 if (!user) | 417 if (!user) |
416 return user_manager::UserManager::Get()->GetActiveUser(); | 418 return user_manager::UserManager::Get()->GetActiveUser(); |
417 return user; | 419 return user; |
418 } | 420 } |
419 | 421 |
420 } // namespace settings | 422 } // namespace settings |
421 } // namespace chromeos | 423 } // namespace chromeos |
OLD | NEW |