summaryrefslogtreecommitdiffstats
path: root/tools/memory_inspector
diff options
context:
space:
mode:
authorpetrcermak <petrcermak@chromium.org>2015-01-23 03:18:20 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-23 11:19:07 +0000
commite0a97a9f2beb6428935cde267611396b68972096 (patch)
treeb3104fbf1b6631c9ef0e4c837fb6790f61cac7f5 /tools/memory_inspector
parentf2b90aae11de413812800c0f37480e64e4542adb (diff)
downloadchromium_src-e0a97a9f2beb6428935cde267611396b68972096.zip
chromium_src-e0a97a9f2beb6428935cde267611396b68972096.tar.gz
chromium_src-e0a97a9f2beb6428935cde267611396b68972096.tar.bz2
[memory-inspector] replace window.alert with rootUi.showDialog
This change is necessary because modal dialogs are not allowed in Chrome Apps. BUG=448399 NOTRY=true Review URL: https://codereview.chromium.org/875433002 Cr-Commit-Position: refs/heads/master@{#312815}
Diffstat (limited to 'tools/memory_inspector')
-rw-r--r--tools/memory_inspector/memory_inspector/frontends/www_content/js/processes.js10
-rw-r--r--tools/memory_inspector/memory_inspector/frontends/www_content/js/storage.js18
2 files changed, 15 insertions, 13 deletions
diff --git a/tools/memory_inspector/memory_inspector/frontends/www_content/js/processes.js b/tools/memory_inspector/memory_inspector/frontends/www_content/js/processes.js
index a7dc142..8921f44 100644
--- a/tools/memory_inspector/memory_inspector/frontends/www_content/js/processes.js
+++ b/tools/memory_inspector/memory_inspector/frontends/www_content/js/processes.js
@@ -65,14 +65,14 @@ this.getSelectedProcessURI = function() {
this.snapshotSelectedProcess_ = function() {
if (!this.selProcUri_)
- return alert('Must select a process!');
+ return rootUi.showDialog('Must select a process!');
mmap.dumpMmaps(this.selProcUri_, true);
rootUi.showTab('prof');
};
this.dumpSelectedProcessMmaps_ = function() {
if (!this.selProcUri_)
- return alert('Must select a process!');
+ return rootUi.showDialog('Must select a process!');
mmap.dumpMmaps(this.selProcUri_, false);
rootUi.showTab('mm');
};
@@ -99,14 +99,14 @@ this.showAndroidProvisionDialog_ = function() {
this.showTracingDialog_ = function() {
if (!this.selProcUri_)
- return alert('Must select a process!');
+ return rootUi.showDialog('Must select a process!');
$('#ps-tracer-process').val(this.selProcName_);
$('#ps-tracer-dialog').dialog('open');
};
this.startTracingSelectedProcess_ = function() {
if (!this.selProcUri_)
- return alert('The process ' + this.selProcUri_ + ' died.');
+ return rootUi.showDialog('The process ' + this.selProcUri_ + ' died.');
var traceNativeHeap = $('#ps-tracer-bt').prop('checked');
$('#ps-tracer-dialog').dialog('close');
@@ -313,4 +313,4 @@ this.clear = function() {
$(document).ready(this.onDomReady_.bind(this));
-})(); \ No newline at end of file
+})();
diff --git a/tools/memory_inspector/memory_inspector/frontends/www_content/js/storage.js b/tools/memory_inspector/memory_inspector/frontends/www_content/js/storage.js
index eddd9aa..07ac71c 100644
--- a/tools/memory_inspector/memory_inspector/frontends/www_content/js/storage.js
+++ b/tools/memory_inspector/memory_inspector/frontends/www_content/js/storage.js
@@ -44,7 +44,7 @@ this.profileMmapForSelectedSnapshots = function(ruleset) {
// Generates a mmap profile for the selected snapshots.
var sel = this.table_.getSelection();
if (!sel.length || !this.tableData_) {
- alert('No snapshots selected!');
+ rootUi.showDialog('No snapshots selected!');
return;
}
var archiveName = null;
@@ -54,7 +54,8 @@ this.profileMmapForSelectedSnapshots = function(ruleset) {
var row = sel[i].row;
var curArchive = this.tableData_.getValue(row, 0);
if (archiveName && curArchive != archiveName) {
- alert('All the selected snapshots must belong to the same archive!');
+ rootUi.showDialog(
+ 'All the selected snapshots must belong to the same archive!');
return;
}
archiveName = curArchive;
@@ -67,7 +68,7 @@ this.profileMmapForSelectedSnapshots = function(ruleset) {
this.dumpMmapForSelectedSnapshot_ = function() {
var sel = this.table_.getSelection();
if (sel.length != 1) {
- alert('Please select only one snapshot.')
+ rootUi.showDialog('Please select only one snapshot.')
return;
}
@@ -80,7 +81,7 @@ this.dumpMmapForSelectedSnapshot_ = function() {
this.dumpNheapForSelectedSnapshot_ = function() {
var sel = this.table_.getSelection();
if (sel.length != 1) {
- alert('Please select only one snapshot.')
+ rootUi.showDialog('Please select only one snapshot.')
return;
}
@@ -96,7 +97,7 @@ this.profileNativeForSelectedSnapshots = function(ruleset) {
// Generates a native heap profile for the selected snapshots.
var sel = this.table_.getSelection();
if (!sel.length || !this.tableData_) {
- alert('No snapshots selected!');
+ rootUi.showDialog('No snapshots selected!');
return;
}
var archiveName = null;
@@ -106,7 +107,8 @@ this.profileNativeForSelectedSnapshots = function(ruleset) {
var row = sel[i].row;
var curArchive = this.tableData_.getValue(row, 0);
if (archiveName && curArchive != archiveName) {
- alert('All the selected snapshots must belong to the same archive!');
+ rootUi.showDialog(
+ 'All the selected snapshots must belong to the same archive!');
return;
}
if (!this.checkHasNativeHapDump_(row))
@@ -120,7 +122,7 @@ this.profileNativeForSelectedSnapshots = function(ruleset) {
this.checkHasNativeHapDump_ = function(row) {
if (!this.tableData_.getValue(row, 3)) {
- alert('The selected snapshot doesn\'t have a heap dump!');
+ rootUi.showDialog('The selected snapshot doesn\'t have a heap dump!');
return false;
}
return true;
@@ -168,4 +170,4 @@ this.redraw = function() {
$(document).ready(this.onDomReady_.bind(this));
-})(); \ No newline at end of file
+})();