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

Side by Side Diff: chrome/browser/ui/webui/policy_material_design_ui.cc

Issue 1995113002: Rename WebUI::CallJavascriptFunction to WebUI::CallJavascriptFunctionUnsafe (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/policy_material_design_ui.h" 5 #include "chrome/browser/ui/webui/policy_material_design_ui.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 list->AppendString(kPolicyRiskTags[tags[i]].key); 79 list->AppendString(kPolicyRiskTags[tags[i]].key);
80 } 80 }
81 names->Set(name, std::move(list)); 81 names->Set(name, std::move(list));
82 } 82 }
83 83
84 void PolicyMaterialDesignUIHandler::SendPolicyNames() const { 84 void PolicyMaterialDesignUIHandler::SendPolicyNames() const {
85 base::ListValue tags; 85 base::ListValue tags;
86 for (size_t tag = 0; tag < policy::RISK_TAG_COUNT; ++tag) 86 for (size_t tag = 0; tag < policy::RISK_TAG_COUNT; ++tag)
87 tags.AppendString(kPolicyRiskTags[tag].key); 87 tags.AppendString(kPolicyRiskTags[tag].key);
88 88
89 web_ui()->CallJavascriptFunction("policy.Page.setPolicyGroups", tags); 89 web_ui()->CallJavascriptFunctionUnsafe("policy.Page.setPolicyGroups", tags);
90 PolicyUIHandler::SendPolicyNames(); 90 PolicyUIHandler::SendPolicyNames();
91 } 91 }
92 92
93 PolicyMaterialDesignUI::PolicyMaterialDesignUI(content::WebUI* web_ui) : 93 PolicyMaterialDesignUI::PolicyMaterialDesignUI(content::WebUI* web_ui) :
94 WebUIController(web_ui) { 94 WebUIController(web_ui) {
95 web_ui->AddMessageHandler(new PolicyMaterialDesignUIHandler); 95 web_ui->AddMessageHandler(new PolicyMaterialDesignUIHandler);
96 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), 96 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui),
97 CreatePolicyMaterialDesignUIHtmlSource()); 97 CreatePolicyMaterialDesignUIHtmlSource());
98 } 98 }
99 99
100 PolicyMaterialDesignUI::~PolicyMaterialDesignUI() { 100 PolicyMaterialDesignUI::~PolicyMaterialDesignUI() {
101 } 101 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698