Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2239)

Unified Diff: chrome/browser/ui/webui/performance_monitor/web_ui.cc

Issue 10820031: Modifications to performance monitor UI to address real webui. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Revised build config to mollify Android tryserver Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/performance_monitor/web_ui.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2299d8b47191b3f2f3eb16fed91b9076324acec0
--- /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.css", IDR_PERFORMANCE_MONITOR_CHART_CSS);
+ source->add_resource_path("chart.js", IDR_PERFORMANCE_MONITOR_CHART_JS);
+ 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
« no previous file with comments | « chrome/browser/ui/webui/performance_monitor/web_ui.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698