OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/webui/performance_monitor/web_ui.h" |
| 6 |
| 7 #include "base/values.h" |
| 8 #include "chrome/browser/performance_monitor/performance_monitor.h" |
| 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 11 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" |
| 12 #include "chrome/browser/ui/webui/performance_monitor/web_ui_handler.h" |
| 13 #include "chrome/common/url_constants.h" |
| 14 #include "content/public/browser/web_ui.h" |
| 15 #include "grit/browser_resources.h" |
| 16 #include "grit/generated_resources.h" |
| 17 |
| 18 namespace { |
| 19 |
| 20 ChromeWebUIDataSource* CreateWebUIHTMLSource() { |
| 21 ChromeWebUIDataSource* source = |
| 22 new ChromeWebUIDataSource(chrome::kChromeUIPerformanceMonitorHost); |
| 23 |
| 24 source->add_resource_path("chart.css", IDR_PERFORMANCE_MONITOR_CHART_CSS); |
| 25 source->add_resource_path("chart.js", IDR_PERFORMANCE_MONITOR_CHART_JS); |
| 26 source->add_resource_path("jquery.js", IDR_PERFORMANCE_MONITOR_JQUERY_JS); |
| 27 source->add_resource_path("flot.js", IDR_PERFORMANCE_MONITOR_JQUERY_FLOT_JS); |
| 28 source->set_default_resource(IDR_PERFORMANCE_MONITOR_HTML); |
| 29 return source; |
| 30 } |
| 31 |
| 32 } // namespace |
| 33 |
| 34 namespace performance_monitor { |
| 35 |
| 36 WebUI::WebUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
| 37 web_ui->AddMessageHandler(new performance_monitor::WebUIHandler()); |
| 38 |
| 39 ChromeWebUIDataSource* html_source = CreateWebUIHTMLSource(); |
| 40 Profile* profile = Profile::FromWebUI(web_ui); |
| 41 ChromeURLDataManager::AddDataSource(profile, html_source); |
| 42 } |
| 43 |
| 44 } // namespace performance_monitor |
OLD | NEW |