summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources
diff options
context:
space:
mode:
authoryoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-05 08:28:07 +0000
committeryoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-05 08:28:07 +0000
commit7b937360dc15b2746cc601620a33a7273a4eb86b (patch)
tree63a6ad4c67f0892a934fa95f1a4b3e2d879359b8 /chrome/browser/resources
parentab6641369e8bbb14d51548fc38848c5885ec0fd6 (diff)
downloadchromium_src-7b937360dc15b2746cc601620a33a7273a4eb86b.zip
chromium_src-7b937360dc15b2746cc601620a33a7273a4eb86b.tar.gz
chromium_src-7b937360dc15b2746cc601620a33a7273a4eb86b.tar.bz2
WebUI TaskManager: Support on Mac & Linux
WebUI TaskManager is enabled when "--enable-task-manager" command-line option is set or when chrome is built with WEBUI_TASK_MANAGER. The title and close button are shown only when task manager is a dialog and chrome runs on ChromeOS. BUG=69222 TEST=manual Review URL: http://codereview.chromium.org/8115005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104075 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources')
-rw-r--r--chrome/browser/resources/task_manager/main.html6
-rw-r--r--chrome/browser/resources/task_manager/main.js21
-rw-r--r--chrome/browser/resources/task_manager/task_manager.css6
3 files changed, 23 insertions, 10 deletions
diff --git a/chrome/browser/resources/task_manager/main.html b/chrome/browser/resources/task_manager/main.html
index d0a15fc..e9bb32b 100644
--- a/chrome/browser/resources/task_manager/main.html
+++ b/chrome/browser/resources/task_manager/main.html
@@ -15,7 +15,8 @@
<link rel="stylesheet" href="task_manager.css">
</head>
<body>
- <div class="dialog-title" i18n-content="TITLE"></div>
+ <div class="dialog-title" i18n-content="TITLE"
+ visibleif='this.opt_.isShowTitle'></div>
<div class="dialog-body">
<div class="list-container">
<div class="detail-table"></div>
@@ -27,7 +28,8 @@
</div>
<div class="footer-right-container">
<button id="kill-process" i18n-content="KILL_CHROMEOS"></button>
- <button id="close-window" i18n-content="CLOSE_WINDOW"></button>
+ <button id="close-window" i18n-content="CLOSE_WINDOW"
+ visibleif='this.opt_.isShowCloseButton'></button>
</div>
</div>
<script src="chrome://resources/js/i18n_template.js"></script>
diff --git a/chrome/browser/resources/task_manager/main.js b/chrome/browser/resources/task_manager/main.js
index 8d58f41..94c7a18 100644
--- a/chrome/browser/resources/task_manager/main.js
+++ b/chrome/browser/resources/task_manager/main.js
@@ -89,13 +89,13 @@ TaskManager.prototype = {
* Initializes taskmanager.
* @public
*/
- initialize: function (dialogDom, backgroundMode) {
+ initialize: function (dialogDom, opt) {
if (!dialogDom) {
console.log('ERROR: dialogDom is not defined.');
return;
}
- this.backgroundMode_ = backgroundMode;
+ this.opt_ = opt;
this.initialized_ = true;
this.enableTaskManager();
@@ -149,6 +149,13 @@ TaskManager.prototype = {
dm.setCompareFunction(column_id, compare_func);
}
+ var ary = this.dialogDom_.querySelectorAll('[visibleif]');
+ for (var i = 0; i < ary.length; i++) {
+ var expr = ary[i].getAttribute('visibleif');
+ if (!eval(expr))
+ ary[i].hidden = true;
+ }
+
this.initTable_();
this.initColumnMenu_();
this.table_.redraw();
@@ -237,7 +244,7 @@ TaskManager.prototype = {
var listItem = new cr.ui.ListItem({label: ''});
listItem.className = 'table-row';
- if (this.backgroundMode_ && dataItem.isBackgroundResource)
+ if (this.opt_.isBackgroundMode_ && dataItem.isBackgroundResource)
listItem.className += ' table-background-row';
for (var i = 0; i < cm.size; i++) {
@@ -369,8 +376,12 @@ TaskManager.prototype = {
var taskmanager = TaskManager.getInstance();
function init() {
- var backgroundMode = (location.hash == '#bg');
- taskmanager.initialize(document.body, backgroundMode);
+ var params = parseQueryParams(window.location);
+ var opt = {};
+ opt['isShowTitle'] = params.showtitle;
+ opt['isBackgroundMode'] = params.background;
+ opt['isShowCloseButton'] = params.showclose;
+ taskmanager.initialize(document.body, opt);
}
function onClose() {
diff --git a/chrome/browser/resources/task_manager/task_manager.css b/chrome/browser/resources/task_manager/task_manager.css
index ffb77b1..8b39fec 100644
--- a/chrome/browser/resources/task_manager/task_manager.css
+++ b/chrome/browser/resources/task_manager/task_manager.css
@@ -31,7 +31,7 @@ body {
font-size: 15px;
font-weight: bold;
margin-bottom: 4px;
- padding: 0px 12px 6px 12px;
+ padding: 0px 12px 4px 12px;
}
/* Container for the detail list views. */
@@ -40,7 +40,7 @@ body {
border: 1px #aaa solid;
border-radius: 3px;
display: -webkit-box;
- margin: 4px 6px;
+ margin: 4px;
}
/* Column text containers. */
@@ -139,7 +139,7 @@ body {
/* Container for footer area. */
.dialog-footer {
display: -webkit-box;
- margin: 4px 6px 10px 6px;
+ margin: 4px;
}
/* Container for the ok/cancel buttons. */