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 |