summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-02 01:31:01 +0000
committerarv@chromium.org <arv@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-02 01:31:01 +0000
commit1217b17153f7a6b553881f851d7ebbd5621ca728 (patch)
treeaf29a33f5450dc7393e28a9f15e473da5ca09c66
parent2b437e23748d7444f1698ae9242fabf0bc0730a7 (diff)
downloadchromium_src-1217b17153f7a6b553881f851d7ebbd5621ca728.zip
chromium_src-1217b17153f7a6b553881f851d7ebbd5621ca728.tar.gz
chromium_src-1217b17153f7a6b553881f851d7ebbd5621ca728.tar.bz2
Disable most commands at startup.
Make sure we do not show the menu on right mouse botton. BUG=40078 TEST=Open the bookmark manager and right click Review URL: http://codereview.chromium.org/1518011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43428 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/resources/bookmark_manager/js/cr/ui/menubutton.js3
-rw-r--r--chrome/browser/resources/bookmark_manager/main.html9
2 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/resources/bookmark_manager/js/cr/ui/menubutton.js b/chrome/browser/resources/bookmark_manager/js/cr/ui/menubutton.js
index 469cfd8..cd8defb 100644
--- a/chrome/browser/resources/bookmark_manager/js/cr/ui/menubutton.js
+++ b/chrome/browser/resources/bookmark_manager/js/cr/ui/menubutton.js
@@ -66,7 +66,8 @@ cr.define('cr.ui', function() {
} else {
if (this.isMenuShown()) {
this.hideMenu();
- } else {
+ } else if (e.button == 0) { // Only show the menu when using left
+ // mouse button.
this.showMenu();
// Prevent the button from stealing focus on mousedown.
e.preventDefault();
diff --git a/chrome/browser/resources/bookmark_manager/main.html b/chrome/browser/resources/bookmark_manager/main.html
index bdff3f1..6792a64 100644
--- a/chrome/browser/resources/bookmark_manager/main.html
+++ b/chrome/browser/resources/bookmark_manager/main.html
@@ -988,6 +988,15 @@ cr.ui.contextMenuHandler.addContextMenuProperty(tree);
list.contextMenu = $('context-menu');
tree.contextMenu = $('context-menu');
+// Disable almost all commands at startup.
+var commands = document.querySelectorAll('command');
+for (var i = 0, command; command = commands[i]; i++) {
+ if (command.id != 'import-menu-command' &&
+ command.id != 'export-menu-command') {
+ command.disabled = true;
+ }
+}
+
/**
* Helper function that updates the canExecute and labels for the open like
* commands.