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

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/base_webui_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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/chromeos/login/base_webui_handler.h" 5 #include "chrome/browser/ui/webui/chromeos/login/base_webui_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/chromeos/login/screens/base_screen.h" 10 #include "chrome/browser/chromeos/login/screens/base_screen.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 void BaseWebUIHandler::ShowScreen(OobeScreen screen) { 71 void BaseWebUIHandler::ShowScreen(OobeScreen screen) {
72 ShowScreenWithData(screen, nullptr); 72 ShowScreenWithData(screen, nullptr);
73 } 73 }
74 74
75 void BaseWebUIHandler::ShowScreenWithData(OobeScreen screen, 75 void BaseWebUIHandler::ShowScreenWithData(OobeScreen screen,
76 const base::DictionaryValue* data) { 76 const base::DictionaryValue* data) {
77 if (!web_ui()) 77 if (!web_ui())
78 return; 78 return;
79 base::DictionaryValue screen_params; 79 base::DictionaryValue screen_params;
80 screen_params.SetString("id", GetOobeScreenName(screen)); 80 screen_params.SetString("id", GetOobeScreenName(screen));
81 if (data) 81 if (data) {
82 screen_params.SetWithoutPathExpansion("data", data->DeepCopy()); 82 screen_params.SetWithoutPathExpansion("data",
83 base::MakeUnique<base::Value>(*data));
84 }
83 web_ui()->CallJavascriptFunctionUnsafe("cr.ui.Oobe.showScreen", 85 web_ui()->CallJavascriptFunctionUnsafe("cr.ui.Oobe.showScreen",
84 screen_params); 86 screen_params);
85 } 87 }
86 88
87 OobeUI* BaseWebUIHandler::GetOobeUI() const { 89 OobeUI* BaseWebUIHandler::GetOobeUI() const {
88 return static_cast<OobeUI*>(web_ui()->GetController()); 90 return static_cast<OobeUI*>(web_ui()->GetController());
89 } 91 }
90 92
91 OobeScreen BaseWebUIHandler::GetCurrentScreen() const { 93 OobeScreen BaseWebUIHandler::GetCurrentScreen() const {
92 OobeUI* oobe_ui = GetOobeUI(); 94 OobeUI* oobe_ui = GetOobeUI();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 128
127 void BaseWebUIHandler::ExecuteDeferredJSCalls() { 129 void BaseWebUIHandler::ExecuteDeferredJSCalls() {
128 DCHECK(!js_calls_container_->is_initialized()); 130 DCHECK(!js_calls_container_->is_initialized());
129 js_calls_container_->mark_initialized(); 131 js_calls_container_->mark_initialized();
130 for (const auto& deferred_js_call : js_calls_container_->deferred_js_calls()) 132 for (const auto& deferred_js_call : js_calls_container_->deferred_js_calls())
131 deferred_js_call.Run(); 133 deferred_js_call.Run();
132 js_calls_container_->deferred_js_calls().clear(); 134 js_calls_container_->deferred_js_calls().clear();
133 } 135 }
134 136
135 } // namespace chromeos 137 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc ('k') | chrome/browser/ui/webui/chromeos/network_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698