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
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/webui/supervised_user_internals_ui.h"
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/ui/webui/supervised_user_internals_message_handler.h"
9 #include "chrome/common/url_constants.h"
10 #include "content/public/browser/web_ui.h"
11 #include "content/public/browser/web_ui_data_source.h"
12 #include "grit/browser_resources.h"
16 content::WebUIDataSource
* CreateSupervisedUserInternalsHTMLSource() {
17 content::WebUIDataSource
* source
= content::WebUIDataSource::Create(
18 chrome::kChromeUISupervisedUserInternalsHost
);
20 source
->AddResourcePath("supervised_user_internals.js",
21 IDR_SUPERVISED_USER_INTERNALS_JS
);
22 source
->AddResourcePath("supervised_user_internals.css",
23 IDR_SUPERVISED_USER_INTERNALS_CSS
);
24 source
->SetDefaultResource(IDR_SUPERVISED_USER_INTERNALS_HTML
);
30 SupervisedUserInternalsUI::SupervisedUserInternalsUI(content::WebUI
* web_ui
)
31 : WebUIController(web_ui
) {
32 Profile
* profile
= Profile::FromWebUI(web_ui
);
33 content::WebUIDataSource::Add(profile
,
34 CreateSupervisedUserInternalsHTMLSource());
36 web_ui
->AddMessageHandler(new SupervisedUserInternalsMessageHandler
);
39 SupervisedUserInternalsUI::~SupervisedUserInternalsUI() {}