Chromium Code Reviews| Index: chrome/browser/ui/webui/performance_monitor/web_ui.cc |
| diff --git a/chrome/browser/ui/webui/performance_monitor/web_ui.cc b/chrome/browser/ui/webui/performance_monitor/web_ui.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..029795b378a6bcad3fac55d78f17a0ef57cdb75b |
| --- /dev/null |
| +++ b/chrome/browser/ui/webui/performance_monitor/web_ui.cc |
| @@ -0,0 +1,44 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/ui/webui/performance_monitor/web_ui.h" |
| + |
| +#include "base/values.h" |
| +#include "chrome/browser/performance_monitor/performance_monitor.h" |
| +#include "chrome/browser/profiles/profile.h" |
| +#include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| +#include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" |
| +#include "chrome/browser/ui/webui/performance_monitor/web_ui_handler.h" |
| +#include "chrome/common/url_constants.h" |
| +#include "content/public/browser/web_ui.h" |
| +#include "grit/browser_resources.h" |
| +#include "grit/generated_resources.h" |
| + |
| +namespace { |
| + |
| +ChromeWebUIDataSource* CreateWebUIHTMLSource() { |
| + ChromeWebUIDataSource* source = |
| + new ChromeWebUIDataSource(chrome::kChromeUIPerformanceMonitorHost); |
| + |
| + source->add_resource_path("chart.js", IDR_PERFORMANCE_MONITOR_CHART_JS); |
| + source->add_resource_path("chart.css", IDR_PERFORMANCE_MONITOR_CHART_CSS); |
|
Evan Stade
2012/07/28 01:01:16
I don't think you need this these two (chart.*). G
clintstaley
2012/07/31 02:34:32
I don't actually have flattenhtml on both, tho, so
Evan Stade
2012/07/31 22:57:02
flattenhtml inlines references. You only need flat
|
| + source->add_resource_path("jquery.js", IDR_PERFORMANCE_MONITOR_JQUERY_JS); |
| + source->add_resource_path("flot.js", IDR_PERFORMANCE_MONITOR_JQUERY_FLOT_JS); |
| + source->set_default_resource(IDR_PERFORMANCE_MONITOR_HTML); |
| + return source; |
| +} |
| + |
| +} // namespace |
| + |
| +namespace performance_monitor { |
| + |
| +WebUI::WebUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
| + web_ui->AddMessageHandler(new performance_monitor::WebUIHandler()); |
| + |
| + ChromeWebUIDataSource* html_source = CreateWebUIHTMLSource(); |
| + Profile* profile = Profile::FromWebUI(web_ui); |
| + ChromeURLDataManager::AddDataSource(profile, html_source); |
| +} |
| + |
| +} // namespace performance_monitor |