diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-07 19:19:56 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-07 19:19:56 +0000 |
commit | 075fb0ffcb8de17e3fc48a27f19d3f7416e10ce4 (patch) | |
tree | 52de24737a6ff899c8c38a0957139b237317c47f | |
parent | 45c0ab867efcd8502f97a349254ea1aaf7098817 (diff) | |
download | chromium_src-075fb0ffcb8de17e3fc48a27f19d3f7416e10ce4.zip chromium_src-075fb0ffcb8de17e3fc48a27f19d3f7416e10ce4.tar.gz chromium_src-075fb0ffcb8de17e3fc48a27f19d3f7416e10ce4.tar.bz2 |
ntp4: some context menu fixes
1 - z-order: make it show on top of the footer
2 - disable uninstall when appropriate
3 - fix appearance of disabled items on linux/gtk (applies to all places menu.js is used)
BUG=none
TEST=see above
Review URL: http://codereview.chromium.org/7227025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91740 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/resources/bookmark_manager/js/main.js | 4 | ||||
-rw-r--r-- | chrome/browser/resources/new_tab.js | 8 | ||||
-rw-r--r-- | chrome/browser/resources/ntp4/apps_page.css | 4 | ||||
-rw-r--r-- | chrome/browser/resources/ntp4/apps_page.js | 1 | ||||
-rw-r--r-- | chrome/browser/resources/ntp4/new_tab.js | 2 | ||||
-rw-r--r-- | chrome/browser/resources/shared/css/menu.css | 6 |
6 files changed, 19 insertions, 6 deletions
diff --git a/chrome/browser/resources/bookmark_manager/js/main.js b/chrome/browser/resources/bookmark_manager/js/main.js index 189f8558..cf3c7fc 100644 --- a/chrome/browser/resources/bookmark_manager/js/main.js +++ b/chrome/browser/resources/bookmark_manager/js/main.js @@ -17,9 +17,7 @@ const Promise = cr.Promise; if (!chrome.bookmarks) console.error('Bookmarks extension API is not available'); -// Allow platform specific CSS rules. -if (cr.isMac) - document.documentElement.setAttribute('os', 'mac'); +cr.enablePlatformSpecificCSSRules(); /** * The local strings object which is used to do the translation. diff --git a/chrome/browser/resources/new_tab.js b/chrome/browser/resources/new_tab.js index 06f0581..148dcb1 100644 --- a/chrome/browser/resources/new_tab.js +++ b/chrome/browser/resources/new_tab.js @@ -1467,10 +1467,12 @@ function isDoneLoading() { return !document.body.classList.contains('loading'); } -// Initialize the listener for the "hide this" link on the apps promo. We do -// this outside of getAppsCallback because it only needs to be done once per -// NTP load. document.addEventListener('DOMContentLoaded', function() { + cr.enablePlatformSpecificCSSRules(); + + // Initialize the listener for the "hide this" link on the apps promo. We do + // this outside of getAppsCallback because it only needs to be done once per + // NTP load. $('apps-promo-hide').addEventListener('click', function() { chrome.send('hideAppsPromo', []); document.documentElement.classList.remove('apps-promo-visible'); diff --git a/chrome/browser/resources/ntp4/apps_page.css b/chrome/browser/resources/ntp4/apps_page.css index c40035e..ce4d6f7 100644 --- a/chrome/browser/resources/ntp4/apps_page.css +++ b/chrome/browser/resources/ntp4/apps_page.css @@ -30,6 +30,10 @@ font-weight: bold; } +.app-context-menu { + z-index: 1000; +} + /* Link (bookmark) tiles. */ .link { display: -webkit-box; diff --git a/chrome/browser/resources/ntp4/apps_page.js b/chrome/browser/resources/ntp4/apps_page.js index 097b4b1..2d37123 100644 --- a/chrome/browser/resources/ntp4/apps_page.js +++ b/chrome/browser/resources/ntp4/apps_page.js @@ -120,6 +120,7 @@ cr.define('ntp4', function() { }); this.options_.disabled = !app.appData.options_url; + this.uninstall_.disabled = !app.appData.can_uninstall; }, /** diff --git a/chrome/browser/resources/ntp4/new_tab.js b/chrome/browser/resources/ntp4/new_tab.js index e01b348..54ba694 100644 --- a/chrome/browser/resources/ntp4/new_tab.js +++ b/chrome/browser/resources/ntp4/new_tab.js @@ -89,6 +89,8 @@ cr.define('ntp4', function() { * Invoked at startup once the DOM is available to initialize the app. */ function initialize() { + cr.enablePlatformSpecificCSSRules(); + // Load the current theme colors. themeChanged(); diff --git a/chrome/browser/resources/shared/css/menu.css b/chrome/browser/resources/shared/css/menu.css index 01c4611..26bbf98 100644 --- a/chrome/browser/resources/shared/css/menu.css +++ b/chrome/browser/resources/shared/css/menu.css @@ -46,6 +46,12 @@ menu > [disabled] { color: rgba(0, 0, 0, .3); } +/* Text alpha doesn't work on Linux/GTK. + * TODO(estade): http://crbug.com/88688. */ +html[toolkit=gtk] menu > [disabled] { + color: #969696; +} + menu > [hidden] { display: none; } |