summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-20 21:47:24 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-20 21:47:24 +0000
commit398d1a99e87fb3f57f6330616f5aa1fd494faced (patch)
tree5cd132ee17c51010962df32a18d7bc7b05dcb5b6 /chrome/browser/resources
parent94ce7252d9efa9d13159dc941cc7f2b762d11d7d (diff)
downloadchromium_src-398d1a99e87fb3f57f6330616f5aa1fd494faced.zip
chromium_src-398d1a99e87fb3f57f6330616f5aa1fd494faced.tar.gz
chromium_src-398d1a99e87fb3f57f6330616f5aa1fd494faced.tar.bz2
Do not show apps section until default apps are installed.
The referenced bugs were side-effects of this underlying issue. BUG=67073,67075 TEST=Run chrome on new profile. Apps section should not show up initially. Go to chrome://extensions/ -> developer mode, and click 'update now'. Apps should show up along with promo. Uninstall all apps. Apps section should keep showing up. Review URL: http://codereview.chromium.org/5958002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69758 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources')
-rw-r--r--chrome/browser/resources/new_new_tab.html16
-rw-r--r--chrome/browser/resources/ntp/apps.js4
2 files changed, 18 insertions, 2 deletions
diff --git a/chrome/browser/resources/new_new_tab.html b/chrome/browser/resources/new_new_tab.html
index 3d50ca0..f987bde 100644
--- a/chrome/browser/resources/new_new_tab.html
+++ b/chrome/browser/resources/new_new_tab.html
@@ -151,7 +151,7 @@ if ('mode' in hashParams) {
<div class="maxiview" id="most-visited-maxiview"></div>
<div class="sections">
- <!-- Start disabled. We only enable if we have at least one app. -->
+ <!-- Start disabled. We only enable once we have installed default apps. -->
<div id="apps" class="section disabled" section="APPS">
<h2>
<img class="disclosure" img src="ntp/ntp_disclosure_triangle.png">
@@ -319,6 +319,20 @@ i18nTemplate.process(document, templateData);
setSectionVisible(
'recently-closed', undefined,
recentlyClosedInitiallyVisible, MINIMIZED_RECENT);
+
+ // This is insane, but we use the CSS class 'disabled' for both 'minimized'
+ // sections and sections that are actually disabled, as in not accessible in
+ // any way.
+ //
+ // The above code syncs up the DOM and shownSection wrt minimized. But we
+ // don't know until we receive the apps data whether the apps section will be
+ // disabled or not. So we need to add the 'disabled' class back to the apps
+ // section here. We remove it later, once we know for sure we want it to be
+ // enabled.
+ //
+ // See also: crbug.com/67273.
+ $('apps').classList.add('disabled');
+
layoutSections();
</script>
</html>
diff --git a/chrome/browser/resources/ntp/apps.js b/chrome/browser/resources/ntp/apps.js
index eef4fa2..32b8a4a 100644
--- a/chrome/browser/resources/ntp/apps.js
+++ b/chrome/browser/resources/ntp/apps.js
@@ -66,7 +66,9 @@ function getAppsCallback(data) {
apps.createWebStoreClosedMenuElement());
}
- if (!(shownSections & MINIMIZED_APPS)) {
+ if (!data.showLauncher || (shownSections & MINIMIZED_APPS)) {
+ appsSection.classList.add('disabled');
+ } else {
appsSection.classList.remove('disabled');
}
addClosedMenuFooter(apps.menu, 'apps', MINIMIZED_APPS, Section.APPS);