diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-09 16:35:18 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-09 16:35:18 +0000 |
commit | ec5b50d6d76fc975f0e7b5e037f28974e13cabb5 (patch) | |
tree | 9643090a68cd8ff404aae0c79330822a855d5270 /chrome/browser/resources | |
parent | e161c191f63808fb0503af5ab05ae5ac176ecfe9 (diff) | |
download | chromium_src-ec5b50d6d76fc975f0e7b5e037f28974e13cabb5.zip chromium_src-ec5b50d6d76fc975f0e7b5e037f28974e13cabb5.tar.gz chromium_src-ec5b50d6d76fc975f0e7b5e037f28974e13cabb5.tar.bz2 |
Implement new strategy for default apps. Instead of using
the component extension system, simply install them as
normal apps the first time Chrome runs. Remove the old
style default apps.
This also removes support for --disable-apps, which doesn't
seem necessary since we already have --disable-extensions.
BUG=53972
TEST=Uninstall any installed apps. Remove the
"default_apps_installed" and "app_promo_counter" keys from
Preferences if they are present.
Start Chrome with the --enable-default-apps flag, navigate
to chrome://extensions/, and click "update now" in the
developer tools. This is to make the updater grab the
apps from the store quicker, so that you don't have to wait
while testing. Normally Chrome would do this by itself
after 5-40 mins.
Go to NTP. You should see gmail, calendar, and docs default
apps show up along with the promo (the text that says "New!
A world of ...").
Refresh the NTP 10 times. The promo should go away on the
10th time.
There are other details. To test each of these, remove all
installed apps and remove the keys from the preferences to
reset the state.
* If you close Chrome before getting the default apps. They
should still show up the next time Chrome is started (after
clicking 'Update now')
* Clicking "hide this message" should hide the promo and it
shouldn't come back on refresh.
* Installing or uninstalling any app should hide the promo,
and it shouldn't come back.
* If the keys from the preferences are removed, but apps
are left installed, the default apps should not be
installed when clicking 'update now'.
* The default apps should only be installed in locale
en-US.
Review URL: http://codereview.chromium.org/3522015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62084 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources')
19 files changed, 15 insertions, 99 deletions
diff --git a/chrome/browser/resources/calendar_app/128.png b/chrome/browser/resources/calendar_app/128.png Binary files differdeleted file mode 100644 index 5ebe636..0000000 --- a/chrome/browser/resources/calendar_app/128.png +++ /dev/null diff --git a/chrome/browser/resources/calendar_app/24.png b/chrome/browser/resources/calendar_app/24.png Binary files differdeleted file mode 100644 index b3a971d..0000000 --- a/chrome/browser/resources/calendar_app/24.png +++ /dev/null diff --git a/chrome/browser/resources/calendar_app/32.png b/chrome/browser/resources/calendar_app/32.png Binary files differdeleted file mode 100644 index e1ac68d..0000000 --- a/chrome/browser/resources/calendar_app/32.png +++ /dev/null diff --git a/chrome/browser/resources/calendar_app/48.png b/chrome/browser/resources/calendar_app/48.png Binary files differdeleted file mode 100644 index 6bfde15..0000000 --- a/chrome/browser/resources/calendar_app/48.png +++ /dev/null diff --git a/chrome/browser/resources/calendar_app/manifest.json b/chrome/browser/resources/calendar_app/manifest.json deleted file mode 100644 index 8bcf843..0000000 --- a/chrome/browser/resources/calendar_app/manifest.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "key": "XX3fMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCf1MLMJ1mzNVJOVqaFFX+fQ7gJLVeZN+Sq3tKnZM33oWP82xDDs345/TsFTqGV3Nj5KvmjIN5NwcW/AeBOpVeOGFujFDSTOCZv0JDKkTXLyCegSwF+ljBi0TbCrsgv2T+8Jt891+hSyw5LPjXoTX2bKz+bu016tQnGnhb6fXyCBQIDAQAB", - "name": "Google Calendar", - "version": "1.3", - "permissions": [ "notifications" ], - "icons": { - "128": "128.png", - "24": "24.png", - "32": "32.png", - "48": "48.png" - }, - "app": { - "urls": [ - "*://www.google.com/calendar/" - ], - "browse_urls": [ - "https://www.google.com/accounts/" - ], - "launch": { - "container": "tab", - "web_url": "https://www.google.com/calendar/" - } - } -} diff --git a/chrome/browser/resources/docs_app/128.png b/chrome/browser/resources/docs_app/128.png Binary files differdeleted file mode 100644 index 0b514a8..0000000 --- a/chrome/browser/resources/docs_app/128.png +++ /dev/null diff --git a/chrome/browser/resources/docs_app/24.png b/chrome/browser/resources/docs_app/24.png Binary files differdeleted file mode 100644 index 7260ac5..0000000 --- a/chrome/browser/resources/docs_app/24.png +++ /dev/null diff --git a/chrome/browser/resources/docs_app/32.png b/chrome/browser/resources/docs_app/32.png Binary files differdeleted file mode 100644 index 6ed8ecd..0000000 --- a/chrome/browser/resources/docs_app/32.png +++ /dev/null diff --git a/chrome/browser/resources/docs_app/48.png b/chrome/browser/resources/docs_app/48.png Binary files differdeleted file mode 100644 index 7440412..0000000 --- a/chrome/browser/resources/docs_app/48.png +++ /dev/null diff --git a/chrome/browser/resources/docs_app/manifest.json b/chrome/browser/resources/docs_app/manifest.json deleted file mode 100644 index 10e965c..0000000 --- a/chrome/browser/resources/docs_app/manifest.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "key": "XX1fMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCfjDZDDE/CHFEYjpPSDjdI3zphzGo7fSxO3+/pQs++FwvA+OpKKhmBga2Sa+f53ujDlPR8Q6mCvy1lXM4M4zD4Hg3lH2LC1wT/YXxJ28afRYW1yEo6/pbpHazij3+FneGMT2xcTyGvgoacJHXOTUqWyCN7qMOCiFDwQ6Uk1zJOPQIDAQAB", - "name": "Google Docs", - "version": "1", - "icons": { - "128": "128.png", - "24": "24.png", - "32": "32.png", - "48": "48.png" - }, - "app": { - "urls": [ - "*://www.google.com/docs/", - "*://docs.google.com/", - "*://docs0.google.com/", - "*://docs1.google.com/", - "*://docs2.google.com/", - "*://docs3.google.com/", - "*://docs4.google.com/", - "*://docs5.google.com/", - "*://docs6.google.com/", - "*://docs7.google.com/", - "*://docs8.google.com/", - "*://docs9.google.com/", - "*://spreadsheets.google.com/", - "*://spreadsheets0.google.com/", - "*://spreadsheets1.google.com/", - "*://spreadsheets2.google.com/", - "*://spreadsheets3.google.com/", - "*://spreadsheets4.google.com/", - "*://spreadsheets5.google.com/", - "*://spreadsheets6.google.com/", - "*://spreadsheets7.google.com/", - "*://spreadsheets8.google.com/", - "*://spreadsheets9.google.com/" - ], - "browse_urls": [ - "https://www.google.com/accounts/" - ], - "launch": { - "web_url": "https://docs.google.com/" - } - } -} diff --git a/chrome/browser/resources/gmail_app/128.png b/chrome/browser/resources/gmail_app/128.png Binary files differdeleted file mode 100644 index 679e7a2..0000000 --- a/chrome/browser/resources/gmail_app/128.png +++ /dev/null diff --git a/chrome/browser/resources/gmail_app/24.png b/chrome/browser/resources/gmail_app/24.png Binary files differdeleted file mode 100644 index 8b14b22..0000000 --- a/chrome/browser/resources/gmail_app/24.png +++ /dev/null diff --git a/chrome/browser/resources/gmail_app/32.png b/chrome/browser/resources/gmail_app/32.png Binary files differdeleted file mode 100644 index bfd8aa4..0000000 --- a/chrome/browser/resources/gmail_app/32.png +++ /dev/null diff --git a/chrome/browser/resources/gmail_app/48.png b/chrome/browser/resources/gmail_app/48.png Binary files differdeleted file mode 100644 index bc1f9fd..0000000 --- a/chrome/browser/resources/gmail_app/48.png +++ /dev/null diff --git a/chrome/browser/resources/gmail_app/manifest.json b/chrome/browser/resources/gmail_app/manifest.json deleted file mode 100644 index 9dfcf98..0000000 --- a/chrome/browser/resources/gmail_app/manifest.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "key": "XX2fMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCfjDZDDE/CHFEYjpPSDjdI3zphzGo7fSxO3+/pQs++FwvA+OpKKhmBga2Sa+f53ujDlPR8Q6mCvy1lXM4M4zD4Hg3lH2LC1wT/YXxJ28afRYW1yEo6/pbpHazij3+FneGMT2xcTyGvgoacJHXOTUqWyCN7qMOCiFDwQ6Uk1zJOPQIDAQAB", - "name": "Google Mail", - "version": "1", - "icons": { - "128": "128.png", - "24": "24.png", - "32": "32.png", - "48": "48.png" - }, - "permissions": [ "notifications" ], - "app": { - "urls": [ - "*://mail.google.com/mail/", - "*://gmail.com/", - "*://www.gmail.com/" - ], - "browse_urls": [ - "https://www.google.com/accounts/" - ], - "launch": { - "web_url": "https://mail.google.com/mail/" - } - } -} diff --git a/chrome/browser/resources/new_new_tab.html b/chrome/browser/resources/new_new_tab.html index 9f78a10..e0f799e 100644 --- a/chrome/browser/resources/new_new_tab.html +++ b/chrome/browser/resources/new_new_tab.html @@ -5,8 +5,7 @@ hasattribution:hasattribution; anim:anim; syncispresent:syncispresent; - customlogo:customlogo; - appspromovisible:appspromovisible" + customlogo:customlogo" install-animation-enabled="true"> <head> <meta charset="utf-8"> diff --git a/chrome/browser/resources/new_new_tab.js b/chrome/browser/resources/new_new_tab.js index 2373582..0a577d4 100644 --- a/chrome/browser/resources/new_new_tab.js +++ b/chrome/browser/resources/new_new_tab.js @@ -1101,4 +1101,10 @@ document.addEventListener('DOMContentLoaded', function() { var promoText1 = $('apps-promo-text1'); promoText1.innerHTML = promoText1.textContent; promoText1.querySelector('a').href = localStrings.getString('web_store_url'); + + $('apps-promo-hide').addEventListener('click', function() { + chrome.send('hideAppsPromo', []); + document.documentElement.classList.remove('apps-promo-visible'); + layoutSections(); + }); }); diff --git a/chrome/browser/resources/ntp/apps.css b/chrome/browser/resources/ntp/apps.css index 45301ab..c92c7a9 100644 --- a/chrome/browser/resources/ntp/apps.css +++ b/chrome/browser/resources/ntp/apps.css @@ -102,7 +102,7 @@ menu > button.default { display: none; } -html[appspromovisible=true] #apps-promo { +html.apps-promo-visible #apps-promo { display: block; } @@ -132,15 +132,15 @@ html[dir=rtl] #apps-promo-hide { float: left; } -html[appspromovisible=true] .app[app-id=web-store-entry] { +html.apps-promo-visible .app[app-id=web-store-entry] { left: 25px; } -html[appspromovisible=true][dir=rtl] .app[app-id=web-store-entry] { +html.apps-promo-visible[dir=rtl] .app[app-id=web-store-entry] { right: 25px; } -html[appspromovisible=true] .app[app-id=web-store-entry] a { +html.apps-promo-visible .app[app-id=web-store-entry] a { font-weight: bold; } diff --git a/chrome/browser/resources/ntp/apps.js b/chrome/browser/resources/ntp/apps.js index dd44532..e6f79a2 100644 --- a/chrome/browser/resources/ntp/apps.js +++ b/chrome/browser/resources/ntp/apps.js @@ -37,6 +37,10 @@ function getAppsCallback(data) { addClosedMenuFooter(apps.menu, 'apps', MINIMIZED_APPS, Section.APPS); apps.loaded = true; + if (data.showPromo) + document.documentElement.classList.add('apps-promo-visible'); + else + document.documentElement.classList.remove('apps-promo-visible'); maybeDoneLoading(); if (data.apps.length > 0 && isDoneLoading()) { |