Modifications to performance monitor UI to address real webui.

UI snapshot: http://imgur.com/js4nc

Review URL: https://chromiumcodereview.appspot.com/10820031

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152214 0039d316-1c4b-4281-b951-d872f2087c98
parent 48f2f46e
...@@ -124,6 +124,13 @@ ...@@ -124,6 +124,13 @@
<include name="IDR_INSTANT_JS" file="resources\instant\instant.js" flattenhtml="true" type="BINDATA" /> <include name="IDR_INSTANT_JS" file="resources\instant\instant.js" flattenhtml="true" type="BINDATA" />
<include name="IDR_MEDIA_INTERNALS_HTML" file="resources\media_internals.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" /> <include name="IDR_MEDIA_INTERNALS_HTML" file="resources\media_internals.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_MEDIA_INTERNALS_JS" file="resources\media_internals\media_internals.js" flattenhtml="true" type="BINDATA" /> <include name="IDR_MEDIA_INTERNALS_JS" file="resources\media_internals\media_internals.js" flattenhtml="true" type="BINDATA" />
<if expr="not pp_ifdef('android')">
<include name="IDR_PERFORMANCE_MONITOR_CHART_CSS" file="resources\performance_monitor\chart.css" flattenhtml="true" type="BINDATA" />
<include name="IDR_PERFORMANCE_MONITOR_CHART_JS" file="resources\performance_monitor\chart.js" type="BINDATA" />
<include name="IDR_PERFORMANCE_MONITOR_HTML" file="resources\performance_monitor\chart.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_PERFORMANCE_MONITOR_JQUERY_FLOT_JS" file="..\..\third_party\flot\jquery.flot.min.js" type="BINDATA" />
<include name="IDR_PERFORMANCE_MONITOR_JQUERY_JS" file="..\..\third_party\flot\jquery.min.js" type="BINDATA" />
</if>
<include name="IDR_PREDICTORS_HTML" file="resources\predictors\predictors.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" /> <include name="IDR_PREDICTORS_HTML" file="resources\predictors\predictors.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
<include name="IDR_PREDICTORS_JS" file="resources\predictors\predictors.js" flattenhtml="true" type="BINDATA" /> <include name="IDR_PREDICTORS_JS" file="resources\predictors\predictors.js" flattenhtml="true" type="BINDATA" />
<if expr="not pp_ifdef('android')"> <if expr="not pp_ifdef('android')">
......
...@@ -2,41 +2,29 @@ ...@@ -2,41 +2,29 @@
* Use of this source code is governed by a BSD-style license that can be * Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file. */ * found in the LICENSE file. */
div#chooseMetrics { #choose-block {
float: left; -webkit-box-orient: horizontal;
background: #eee;
display: -webkit-box;
} }
div#chooseEvents { .spacer {
float: left; -webkit-box-flex: 1;
margin-left: 20px;
} }
div#chooseTimeRange { /* |charts| is the style for the div enclosing all charts, collectively. Its
float: right; * dimensions must increase if the div encloses more than one chart.
} * |chart| is the style for any div that encloses a single chart -- a
* child div of the larger #charts div. */
div#chooseBlock { #charts,
background: #eee; .chart {
overflow: hidden; height: 500px;
} width: 900px;
div#charts {
height: 500px;
width: 900px;
}
div.chart {
height: 500px;
width: 900px;
} }
div.event-label { div.event-label {
background: #fff; background: white;
border: 1px solid; border: 1px solid;
font: 0.6em; font: 0.6em;
position: absolute; position: absolute;
}
.hidden {
visibility: hidden;
} }
...@@ -5,46 +5,47 @@ Use of this source code is governed by a BSD-style license that can be ...@@ -5,46 +5,47 @@ Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file. --> found in the LICENSE file. -->
<!-- This page uses Flot version 0.7 in compressed form for efficiency. <!-- This page uses Flot version 0.7 in compressed form for efficiency.
Readable Flot source is available at http://code.google.com/p/flot/ Readable Flot source is available at http://code.google.com/p/flot/
Good caliber Flot API docs are at: http://people.iola.dk/olau/flot/API.txt Good caliber Flot API docs are at: http://people.iola.dk/olau/flot/API.txt
as of 6/2012 --> as of 6/2012. -->
<html> <html>
<head> <head>
<script type="text/javascript"
src="../../../../third_party/flot/jquery.min.js"></script>
<script type="text/javascript"
src="../../../../third_party/flot/jquery.flot.min.js"></script>
<link rel="stylesheet" type="text/css" href="chart.css"/> <link rel="stylesheet" type="text/css" href="chart.css"/>
</head> </head>
<body> <body>
<div id="chooseBlock"> <div id="choose-block">
<div id="chooseMetrics"> <div id="choose-metrics">
<h2>Choose Metrics</h2> <h2>Choose Metrics</h2>
</div> </div>
<div id="chooseEvents"> <div id="choose-events">
<h2>Choose Events</h2> <h2>Choose Events</h2>
</div> </div>
<div id="chooseTimeRange"> <div class="spacer"></div>
<div id="choose-time-range">
<h2>Choose Time Range</h2> <h2>Choose Time Range</h2>
</div> </div>
</div> </div>
<div id="charts"></div> <div id="charts"></div>
<div id="templates" class="hidden"> <div id="templates" hidden>
<div id="labelTemplate" class="event-label"></div> <div id="label-template" class="event-label"></div>
<div id="checkboxTemplate" class="checkbox"> <div id="checkbox-template" class="checkbox">
<label> <label>
<input type="checkbox"></input> <input type="checkbox"></input>
<span>Change this label</span> <span>Change this label</span>
</label> </label>
</div> </div>
<div id="radioTemplate" class="radio"> <div id="radio-template" class="radio">
<label> <label>
<input type="radio" name="TimeRange"/> <input type="radio" name="time-range"/>
<span>Change this label</span> <span>Change this label</span>
</label> </label>
</div> </div>
</div> </div>
<script type="text/javascript" src="chart.js"></script> <script src="chrome://resources/js/cr.js"></script>
<script src="chrome://resources/js/util.js"></script>
<script src="jquery.js"></script>
<script src="flot.js"></script>
<script src="chart.js"></script>
</body> </body>
</html> </html>
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include "chrome/browser/ui/webui/ntp/new_tab_ui.h" #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
#include "chrome/browser/ui/webui/omnibox/omnibox_ui.h" #include "chrome/browser/ui/webui/omnibox/omnibox_ui.h"
#include "chrome/browser/ui/webui/options2/options_ui.h" #include "chrome/browser/ui/webui/options2/options_ui.h"
#include "chrome/browser/ui/webui/performance_monitor/web_ui.h"
#include "chrome/browser/ui/webui/plugins_ui.h" #include "chrome/browser/ui/webui/plugins_ui.h"
#include "chrome/browser/ui/webui/policy_ui.h" #include "chrome/browser/ui/webui/policy_ui.h"
#include "chrome/browser/ui/webui/predictors/predictors_ui.h" #include "chrome/browser/ui/webui/predictors/predictors_ui.h"
...@@ -263,6 +264,9 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui, ...@@ -263,6 +264,9 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
// Android does not support plugins for now. // Android does not support plugins for now.
if (url.host() == chrome::kChromeUIPluginsHost) if (url.host() == chrome::kChromeUIPluginsHost)
return &NewWebUI<PluginsUI>; return &NewWebUI<PluginsUI>;
// Performance monitoring page is not on Android for now.
if (url.host() == chrome::kChromeUIPerformanceMonitorHost)
return &NewWebUI<performance_monitor::WebUI>;
#endif #endif
#if defined(ENABLE_EXTENSIONS) #if defined(ENABLE_EXTENSIONS)
if (url.host() == chrome::kChromeUIExtensionsFrameHost) if (url.host() == chrome::kChromeUIExtensionsFrameHost)
......
// 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
// 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.
#ifndef CHROME_BROWSER_UI_WEBUI_PERFORMANCE_MONITOR_WEB_UI_H_
#define CHROME_BROWSER_UI_WEBUI_PERFORMANCE_MONITOR_WEB_UI_H_
#include "content/public/browser/web_ui_controller.h"
namespace performance_monitor {
class WebUI : public content::WebUIController {
public:
explicit WebUI(content::WebUI* web_ui);
private:
DISALLOW_COPY_AND_ASSIGN(WebUI);
};
} // namespace performance_monitor
#endif // CHROME_BROWSER_UI_WEBUI_PERFORMANCE_MONITOR_WEB_UI_H_
...@@ -4221,6 +4221,8 @@ ...@@ -4221,6 +4221,8 @@
'browser/ui/webui/options2/startup_pages_handler.h', 'browser/ui/webui/options2/startup_pages_handler.h',
'browser/ui/webui/options2/web_intents_settings_handler.cc', 'browser/ui/webui/options2/web_intents_settings_handler.cc',
'browser/ui/webui/options2/web_intents_settings_handler.h', 'browser/ui/webui/options2/web_intents_settings_handler.h',
'browser/ui/webui/performance_monitor/web_ui.cc',
'browser/ui/webui/performance_monitor/web_ui.h',
'browser/ui/webui/performance_monitor/web_ui_handler.cc', 'browser/ui/webui/performance_monitor/web_ui_handler.cc',
'browser/ui/webui/performance_monitor/web_ui_handler.h', 'browser/ui/webui/performance_monitor/web_ui_handler.h',
'browser/ui/webui/plugins_ui.cc', 'browser/ui/webui/plugins_ui.cc',
...@@ -5035,6 +5037,8 @@ ...@@ -5035,6 +5037,8 @@
'browser/ui/webui/ntp/app_launcher_handler.cc', 'browser/ui/webui/ntp/app_launcher_handler.cc',
'browser/ui/webui/ntp/app_launcher_handler.h', 'browser/ui/webui/ntp/app_launcher_handler.h',
'browser/ui/webui/ntp/ntp_resource_cache.cc', 'browser/ui/webui/ntp/ntp_resource_cache.cc',
'browser/ui/webui/performance_monitor/web_ui.cc',
'browser/ui/webui/performance_monitor/web_ui_handler.cc',
'browser/ui/webui/plugins_ui.cc', 'browser/ui/webui/plugins_ui.cc',
'browser/ui/webui/plugins_ui.h', 'browser/ui/webui/plugins_ui.h',
'browser/ui/window_sizer/window_sizer.cc', 'browser/ui/window_sizer/window_sizer.cc',
......
...@@ -62,6 +62,7 @@ const char kChromeUINetInternalsURL[] = "chrome://net-internals/"; ...@@ -62,6 +62,7 @@ const char kChromeUINetInternalsURL[] = "chrome://net-internals/";
const char kChromeUINewProfile[] = "chrome://newprofile/"; const char kChromeUINewProfile[] = "chrome://newprofile/";
const char kChromeUINewTabURL[] = "chrome://newtab/"; const char kChromeUINewTabURL[] = "chrome://newtab/";
const char kChromeUIOmniboxURL[] = "chrome://omnibox/"; const char kChromeUIOmniboxURL[] = "chrome://omnibox/";
const char kChromeUIPerformanceMonitorURL[] = "chrome://performance/";
const char kChromeUIPluginsURL[] = "chrome://plugins/"; const char kChromeUIPluginsURL[] = "chrome://plugins/";
const char kChromeUIPolicyURL[] = "chrome://policy/"; const char kChromeUIPolicyURL[] = "chrome://policy/";
const char kChromeUIPrintURL[] = "chrome://print/"; const char kChromeUIPrintURL[] = "chrome://print/";
...@@ -182,6 +183,7 @@ const char kChromeUINaClHost[] = "nacl"; ...@@ -182,6 +183,7 @@ const char kChromeUINaClHost[] = "nacl";
const char kChromeUINetInternalsHost[] = "net-internals"; const char kChromeUINetInternalsHost[] = "net-internals";
const char kChromeUINewTabHost[] = "newtab"; const char kChromeUINewTabHost[] = "newtab";
const char kChromeUIOmniboxHost[] = "omnibox"; const char kChromeUIOmniboxHost[] = "omnibox";
const char kChromeUIPerformanceMonitorHost[] = "performance";
const char kChromeUIPluginsHost[] = "plugins"; const char kChromeUIPluginsHost[] = "plugins";
const char kChromeUIPolicyHost[] = "policy"; const char kChromeUIPolicyHost[] = "policy";
const char kChromeUIPredictorsHost[] = "predictors"; const char kChromeUIPredictorsHost[] = "predictors";
......
...@@ -55,6 +55,7 @@ extern const char kChromeUINetInternalsURL[]; ...@@ -55,6 +55,7 @@ extern const char kChromeUINetInternalsURL[];
extern const char kChromeUINewProfile[]; extern const char kChromeUINewProfile[];
extern const char kChromeUINewTabURL[]; extern const char kChromeUINewTabURL[];
extern const char kChromeUIOmniboxURL[]; extern const char kChromeUIOmniboxURL[];
extern const char kChromeUIPerformanceMonitorURL[];
extern const char kChromeUIPluginsURL[]; extern const char kChromeUIPluginsURL[];
extern const char kChromeUIPolicyURL[]; extern const char kChromeUIPolicyURL[];
extern const char kChromeUIPrintURL[]; extern const char kChromeUIPrintURL[];
...@@ -171,6 +172,7 @@ extern const char kChromeUINaClHost[]; ...@@ -171,6 +172,7 @@ extern const char kChromeUINaClHost[];
extern const char kChromeUINetInternalsHost[]; extern const char kChromeUINetInternalsHost[];
extern const char kChromeUINewTabHost[]; extern const char kChromeUINewTabHost[];
extern const char kChromeUIOmniboxHost[]; extern const char kChromeUIOmniboxHost[];
extern const char kChromeUIPerformanceMonitorHost[];
extern const char kChromeUIPluginsHost[]; extern const char kChromeUIPluginsHost[];
extern const char kChromeUIPolicyHost[]; extern const char kChromeUIPolicyHost[];
extern const char kChromeUIPredictorsHost[]; extern const char kChromeUIPredictorsHost[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment