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

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: Replace Set/Get pairs by new Set 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)
Nico 2017/05/02 19:00:34 nit: add {}
jdoerrie 2017/05/02 19:39:32 Done.
82 screen_params.SetWithoutPathExpansion("data", data->DeepCopy()); 82 screen_params.SetWithoutPathExpansion("data",
83 base::MakeUnique<base::Value>(*data));
83 web_ui()->CallJavascriptFunctionUnsafe("cr.ui.Oobe.showScreen", 84 web_ui()->CallJavascriptFunctionUnsafe("cr.ui.Oobe.showScreen",
84 screen_params); 85 screen_params);
85 } 86 }
86 87
87 OobeUI* BaseWebUIHandler::GetOobeUI() const { 88 OobeUI* BaseWebUIHandler::GetOobeUI() const {
88 return static_cast<OobeUI*>(web_ui()->GetController()); 89 return static_cast<OobeUI*>(web_ui()->GetController());
89 } 90 }
90 91
91 OobeScreen BaseWebUIHandler::GetCurrentScreen() const { 92 OobeScreen BaseWebUIHandler::GetCurrentScreen() const {
92 OobeUI* oobe_ui = GetOobeUI(); 93 OobeUI* oobe_ui = GetOobeUI();
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 127
127 void BaseWebUIHandler::ExecuteDeferredJSCalls() { 128 void BaseWebUIHandler::ExecuteDeferredJSCalls() {
128 DCHECK(!js_calls_container_->is_initialized()); 129 DCHECK(!js_calls_container_->is_initialized());
129 js_calls_container_->mark_initialized(); 130 js_calls_container_->mark_initialized();
130 for (const auto& deferred_js_call : js_calls_container_->deferred_js_calls()) 131 for (const auto& deferred_js_call : js_calls_container_->deferred_js_calls())
131 deferred_js_call.Run(); 132 deferred_js_call.Run();
132 js_calls_container_->deferred_js_calls().clear(); 133 js_calls_container_->deferred_js_calls().clear();
133 } 134 }
134 135
135 } // namespace chromeos 136 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698