Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5353)

Unified Diff: chrome/browser/resources/app_list/start_page.js

Issue 871193006: Add a static Google Doodle to the experimental app list start page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_xiyuan_start_page
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/app_list/start_page.js
diff --git a/chrome/browser/resources/app_list/start_page.js b/chrome/browser/resources/app_list/start_page.js
index 21ccc4ebd86842a2a7bb054751619a2a998824ee..920661f11e1eed0d89436412530345e9e72c8f5e 100644
--- a/chrome/browser/resources/app_list/start_page.js
+++ b/chrome/browser/resources/app_list/start_page.js
@@ -48,6 +48,27 @@ cr.define('appList.startPage', function() {
}
/**
+ * Invoked when the app-list doodle is updated.
+ *
+ * @param {Object} data The data object representing the current doodle.
Matt Giuca 2015/01/29 08:00:53 Any reason you pass the whole JSON in? Why not gra
calamity 2015/01/30 05:09:14 There are other fields we're interested in such as
Matt Giuca 2015/02/02 06:23:14 Acknowledged.
+ */
+ function onAppListDoodleUpdated(data, base_url) {
+ var defaultLogo = $('logo');
+ var doodle = $('doodle');
+ if (!data.ddljson || !data.ddljson.transparent_large_image) {
+ defaultLogo.style.display = 'block';
+ doodle.style.display = 'none';
+ return;
+ }
+
+ doodle.onload = function() {
+ defaultLogo.style.display = 'none';
+ doodle.style.display = 'block';
+ };
+ doodle.src = base_url + data.ddljson.transparent_large_image.url;
+ }
+
+ /**
* Invoked when the app-list bubble is hidden.
*/
function onAppListHidden() {
@@ -66,6 +87,7 @@ cr.define('appList.startPage', function() {
initialize: initialize,
setHotwordEnabled: setHotwordEnabled,
setNaclArch: setNaclArch,
+ onAppListDoodleUpdated: onAppListDoodleUpdated,
onAppListShown: onAppListShown,
onAppListHidden: onAppListHidden,
toggleSpeechRecognition: toggleSpeechRecognition

Powered by Google App Engine
This is Rietveld 408576698