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

Side by Side Diff: chrome/browser/ui/webui/extensions/chromeos/kiosk_apps_handler.cc

Issue 2845113002: Remove raw base::DictionaryValue::SetWithoutPathExpansion in //chrome (Closed)
Patch Set: Address comments Created 3 years, 7 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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/extensions/chromeos/kiosk_apps_handler.h" 5 #include "chrome/browser/ui/webui/extensions/chromeos/kiosk_apps_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 kiosk_app_manager_->GetApps(&apps); 266 kiosk_app_manager_->GetApps(&apps);
267 267
268 std::unique_ptr<base::ListValue> apps_list(new base::ListValue); 268 std::unique_ptr<base::ListValue> apps_list(new base::ListValue);
269 for (size_t i = 0; i < apps.size(); ++i) { 269 for (size_t i = 0; i < apps.size(); ++i) {
270 const KioskAppManager::App& app_data = apps[i]; 270 const KioskAppManager::App& app_data = apps[i];
271 271
272 std::unique_ptr<base::DictionaryValue> app_info(new base::DictionaryValue); 272 std::unique_ptr<base::DictionaryValue> app_info(new base::DictionaryValue);
273 PopulateAppDict(app_data, app_info.get()); 273 PopulateAppDict(app_data, app_info.get());
274 apps_list->Append(std::move(app_info)); 274 apps_list->Append(std::move(app_info));
275 } 275 }
276 settings.SetWithoutPathExpansion("apps", apps_list.release()); 276 settings.SetWithoutPathExpansion("apps", std::move(apps_list));
277 277
278 web_ui()->CallJavascriptFunctionUnsafe( 278 web_ui()->CallJavascriptFunctionUnsafe(
279 "extensions.KioskAppsOverlay.setSettings", settings); 279 "extensions.KioskAppsOverlay.setSettings", settings);
280 } 280 }
281 281
282 void KioskAppsHandler::HandleInitializeKioskAppSettings( 282 void KioskAppsHandler::HandleInitializeKioskAppSettings(
283 const base::ListValue* args) { 283 const base::ListValue* args) {
284 KioskAppManager::Get()->GetConsumerKioskAutoLaunchStatus( 284 KioskAppManager::Get()->GetConsumerKioskAutoLaunchStatus(
285 base::Bind(&KioskAppsHandler::OnGetConsumerKioskAutoLaunchStatus, 285 base::Bind(&KioskAppsHandler::OnGetConsumerKioskAutoLaunchStatus,
286 weak_ptr_factory_.GetWeakPtr())); 286 weak_ptr_factory_.GetWeakPtr()));
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 370
371 void KioskAppsHandler::ShowError(const std::string& app_id) { 371 void KioskAppsHandler::ShowError(const std::string& app_id) {
372 base::Value app_id_value(app_id); 372 base::Value app_id_value(app_id);
373 web_ui()->CallJavascriptFunctionUnsafe( 373 web_ui()->CallJavascriptFunctionUnsafe(
374 "extensions.KioskAppsOverlay.showError", app_id_value); 374 "extensions.KioskAppsOverlay.showError", app_id_value);
375 375
376 kiosk_app_manager_->RemoveApp(app_id, owner_settings_service_); 376 kiosk_app_manager_->RemoveApp(app_id, owner_settings_service_);
377 } 377 }
378 378
379 } // namespace chromeos 379 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chromeos/network_ui.cc ('k') | chrome/browser/ui/webui/settings/profile_info_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698