OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 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/supervised_user_internals_ui.h" | 5 #include "chrome/browser/ui/webui/supervised_user_internals_ui.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/ui/webui/supervised_user_internals_message_handler.h" | 8 #include "chrome/browser/ui/webui/supervised_user_internals_message_handler.h" |
9 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
10 #include "chrome/grit/browser_resources.h" | 10 #include "chrome/grit/browser_resources.h" |
11 #include "content/public/browser/web_ui.h" | 11 #include "content/public/browser/web_ui.h" |
12 #include "content/public/browser/web_ui_data_source.h" | 12 #include "content/public/browser/web_ui_data_source.h" |
13 | 13 |
14 namespace { | 14 namespace { |
15 | 15 |
16 content::WebUIDataSource* CreateSupervisedUserInternalsHTMLSource() { | 16 content::WebUIDataSource* CreateSupervisedUserInternalsHTMLSource() { |
17 content::WebUIDataSource* source = content::WebUIDataSource::Create( | 17 content::WebUIDataSource* source = content::WebUIDataSource::Create( |
18 chrome::kChromeUISupervisedUserInternalsHost); | 18 chrome::kChromeUISupervisedUserInternalsHost); |
19 | 19 |
20 source->AddResourcePath("supervised_user_internals.js", | 20 source->AddResourcePath("supervised_user_internals.js", |
21 IDR_SUPERVISED_USER_INTERNALS_JS); | 21 IDR_SUPERVISED_USER_INTERNALS_JS); |
22 source->AddResourcePath("supervised_user_internals.css", | 22 source->AddResourcePath("supervised_user_internals.css", |
23 IDR_SUPERVISED_USER_INTERNALS_CSS); | 23 IDR_SUPERVISED_USER_INTERNALS_CSS); |
24 source->SetDefaultResource(IDR_SUPERVISED_USER_INTERNALS_HTML); | 24 source->SetDefaultResource(IDR_SUPERVISED_USER_INTERNALS_HTML); |
25 source->DisableI18nAndUseGzipForAllPaths(); | 25 source->UseGzip(std::unordered_set<std::string>()); |
26 return source; | 26 return source; |
27 } | 27 } |
28 | 28 |
29 } // namespace | 29 } // namespace |
30 | 30 |
31 SupervisedUserInternalsUI::SupervisedUserInternalsUI(content::WebUI* web_ui) | 31 SupervisedUserInternalsUI::SupervisedUserInternalsUI(content::WebUI* web_ui) |
32 : WebUIController(web_ui) { | 32 : WebUIController(web_ui) { |
33 Profile* profile = Profile::FromWebUI(web_ui); | 33 Profile* profile = Profile::FromWebUI(web_ui); |
34 content::WebUIDataSource::Add(profile, | 34 content::WebUIDataSource::Add(profile, |
35 CreateSupervisedUserInternalsHTMLSource()); | 35 CreateSupervisedUserInternalsHTMLSource()); |
36 | 36 |
37 web_ui->AddMessageHandler(new SupervisedUserInternalsMessageHandler); | 37 web_ui->AddMessageHandler(new SupervisedUserInternalsMessageHandler); |
38 } | 38 } |
39 | 39 |
40 SupervisedUserInternalsUI::~SupervisedUserInternalsUI() {} | 40 SupervisedUserInternalsUI::~SupervisedUserInternalsUI() {} |
OLD | NEW |