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

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: Final touchups for style. Created 8 years, 5 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
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

Powered by Google App Engine
This is Rietveld 408576698