| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_ui.h" | 5 #include "chrome/browser/ui/webui/policy_ui.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/webui/policy_ui_handler.h" | 9 #include "chrome/browser/ui/webui/policy_ui_handler.h" |
| 10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 source->AddLocalizedString("labelStatus", IDS_POLICY_LABEL_STATUS); | 39 source->AddLocalizedString("labelStatus", IDS_POLICY_LABEL_STATUS); |
| 40 source->AddLocalizedString("showUnset", IDS_POLICY_SHOW_UNSET); | 40 source->AddLocalizedString("showUnset", IDS_POLICY_SHOW_UNSET); |
| 41 source->AddLocalizedString("noPoliciesSet", IDS_POLICY_NO_POLICIES_SET); | 41 source->AddLocalizedString("noPoliciesSet", IDS_POLICY_NO_POLICIES_SET); |
| 42 source->AddLocalizedString("showExpandedValue", | 42 source->AddLocalizedString("showExpandedValue", |
| 43 IDS_POLICY_SHOW_EXPANDED_VALUE); | 43 IDS_POLICY_SHOW_EXPANDED_VALUE); |
| 44 source->AddLocalizedString("hideExpandedValue", | 44 source->AddLocalizedString("hideExpandedValue", |
| 45 IDS_POLICY_HIDE_EXPANDED_VALUE); | 45 IDS_POLICY_HIDE_EXPANDED_VALUE); |
| 46 // Add required resources. | 46 // Add required resources. |
| 47 source->AddResourcePath("policy.css", IDR_POLICY_CSS); | 47 source->AddResourcePath("policy.css", IDR_POLICY_CSS); |
| 48 source->AddResourcePath("policy.js", IDR_POLICY_JS); | 48 source->AddResourcePath("policy.js", IDR_POLICY_JS); |
| 49 source->AddResourcePath("uber_utils.js", IDR_UBER_UTILS_JS); | |
| 50 source->SetDefaultResource(IDR_POLICY_HTML); | 49 source->SetDefaultResource(IDR_POLICY_HTML); |
| 51 return source; | 50 return source; |
| 52 } | 51 } |
| 53 | 52 |
| 54 } // namespace | 53 } // namespace |
| 55 | 54 |
| 56 PolicyUI::PolicyUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 55 PolicyUI::PolicyUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
| 57 web_ui->AddMessageHandler(base::MakeUnique<PolicyUIHandler>()); | 56 web_ui->AddMessageHandler(base::MakeUnique<PolicyUIHandler>()); |
| 58 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), | 57 content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), |
| 59 CreatePolicyUIHtmlSource()); | 58 CreatePolicyUIHtmlSource()); |
| 60 } | 59 } |
| 61 | 60 |
| 62 PolicyUI::~PolicyUI() { | 61 PolicyUI::~PolicyUI() { |
| 63 } | 62 } |
| OLD | NEW |