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

Unified Diff: chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.cc

Issue 14063018: Implemented argument wrapping for CallJS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix. Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.cc
index cfad222849ae003edbcc5a796dfd41da7e027820..61daf34f3714cd2afad52a9f03980a4c311ae39d 100644
--- a/chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.cc
@@ -4,7 +4,6 @@
#include "chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.h"
-#include "base/values.h"
#include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -94,11 +93,8 @@ void TermsOfServiceScreenHandler::Initialize() {
}
void TermsOfServiceScreenHandler::UpdateDomainInUI() {
- if (!page_is_ready())
- return;
-
- base::StringValue domain(domain_);
- CallJS("cr.ui.Oobe.setTermsOfServiceDomain", domain);
+ if (page_is_ready())
+ CallJS("cr.ui.Oobe.setTermsOfServiceDomain", domain_);
}
void TermsOfServiceScreenHandler::UpdateTermsOfServiceInUI() {
@@ -109,13 +105,10 @@ void TermsOfServiceScreenHandler::UpdateTermsOfServiceInUI() {
// Terms of Service has completed and the UI should be updated. Otherwise, the
// download is still in progress and the UI will be updated when the
// OnLoadError() or the OnLoadSuccess() callback is called.
- if (load_error_) {
- web_ui()->CallJavascriptFunction("cr.ui.Oobe.setTermsOfServiceLoadError");
- } else if (!terms_of_service_.empty()) {
- base::StringValue terms_of_service(terms_of_service_);
- web_ui()->CallJavascriptFunction("cr.ui.Oobe.setTermsOfService",
- terms_of_service);
- }
+ if (load_error_)
+ CallJS("cr.ui.Oobe.setTermsOfServiceLoadError");
+ else if (!terms_of_service_.empty())
+ CallJS("cr.ui.Oobe.setTermsOfService", terms_of_service_);
}
void TermsOfServiceScreenHandler::HandleBack() {

Powered by Google App Engine
This is Rietveld 408576698