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

Unified Diff: chrome/browser/ui/webui/policy_ui.cc

Issue 1321713004: Flag for Material Design policy construction page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing nits. Created 5 years, 2 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
« no previous file with comments | « chrome/browser/ui/webui/policy_ui.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/policy_ui.cc
diff --git a/chrome/browser/ui/webui/policy_ui.cc b/chrome/browser/ui/webui/policy_ui.cc
index 7c646e0d19260c0b6334bdd109a985c91ffc81bf..a735c7f8cfaf707a99ab2b5ce4ee6c1817d5efb4 100644
--- a/chrome/browser/ui/webui/policy_ui.cc
+++ b/chrome/browser/ui/webui/policy_ui.cc
@@ -101,11 +101,7 @@ void AddLocalizedPoilcySourceStrings(content::WebUIDataSource* source) {
}
}
-content::WebUIDataSource* CreatePolicyUIHTMLSource() {
- content::WebUIDataSource* source =
- content::WebUIDataSource::Create(chrome::kChromeUIPolicyHost);
-
- // Localized strings.
+void AddCommonLocalizedStringsToSource(content::WebUIDataSource* source) {
source->AddLocalizedString("title", IDS_POLICY_TITLE);
source->AddLocalizedString("filterPlaceholder",
IDS_POLICY_FILTER_PLACEHOLDER);
@@ -148,7 +144,22 @@ content::WebUIDataSource* CreatePolicyUIHTMLSource() {
AddLocalizedPoilcySourceStrings(source);
source->SetJsonPath("strings.js");
+}
+
+content::WebUIDataSource* CreatePolicyMaterialDesignUIHtmlSource() {
+ content::WebUIDataSource* source =
+ content::WebUIDataSource::Create(chrome::kChromeUIMdPolicyHost);
+ AddCommonLocalizedStringsToSource(source);
+ source->SetDefaultResource(IDR_MD_POLICY_HTML);
+
+ return source;
+}
+
+content::WebUIDataSource* CreatePolicyUIHtmlSource() {
+ content::WebUIDataSource* source =
+ content::WebUIDataSource::Create(chrome::kChromeUIPolicyHost);
+ AddCommonLocalizedStringsToSource(source);
// Add required resources.
source->AddResourcePath("policy.css", IDR_POLICY_CSS);
source->AddResourcePath("policy.js", IDR_POLICY_JS);
@@ -866,8 +877,18 @@ policy::PolicyService* PolicyUIHandler::GetPolicyService() const {
PolicyUI::PolicyUI(content::WebUI* web_ui) : WebUIController(web_ui) {
web_ui->AddMessageHandler(new PolicyUIHandler);
content::WebUIDataSource::Add(Profile::FromWebUI(web_ui),
- CreatePolicyUIHTMLSource());
+ CreatePolicyUIHtmlSource());
}
PolicyUI::~PolicyUI() {
}
+
+PolicyMaterialDesignUI::PolicyMaterialDesignUI(content::WebUI* web_ui) :
+ WebUIController(web_ui) {
+ web_ui->AddMessageHandler(new PolicyUIHandler);
+ content::WebUIDataSource::Add(Profile::FromWebUI(web_ui),
+ CreatePolicyMaterialDesignUIHtmlSource());
+}
+
+PolicyMaterialDesignUI::~PolicyMaterialDesignUI() {
+}
« no previous file with comments | « chrome/browser/ui/webui/policy_ui.h ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698