Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / webui / gcm_internals_ui.cc
1 // Copyright 2014 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.
4
5 #include "chrome/browser/ui/webui/gcm_internals_ui.h"
6
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/common/url_constants.h"
9 #include "content/public/browser/web_ui_data_source.h"
10 #include "grit/browser_resources.h"
11
12 GCMInternalsUI::GCMInternalsUI(content::WebUI* web_ui)
13     : content::WebUIController(web_ui) {
14   // Set up the chrome://gcm-internals source.
15   content::WebUIDataSource* html_source =
16       content::WebUIDataSource::Create(chrome::kChromeUIGCMInternalsHost);
17   html_source->SetUseJsonJSFormatV2();
18
19   html_source->SetJsonPath("strings.js");
20
21   // Add required resources.
22   html_source->AddResourcePath("gcm_internals.css", IDR_GCM_INTERNALS_CSS);
23   html_source->AddResourcePath("gcm_internals.js", IDR_GCM_INTERNALS_JS);
24   html_source->SetDefaultResource(IDR_GCM_INTERNALS_HTML);
25
26   Profile* profile = Profile::FromWebUI(web_ui);
27   content::WebUIDataSource::Add(profile, html_source);
28 }
29
30 GCMInternalsUI::~GCMInternalsUI() {}