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

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: address_comments 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
« no previous file with comments | « chrome/browser/resources/app_list/start_page.html ('k') | chrome/browser/ui/app_list/start_page_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ce8c734bf45d7fad5140fe3582094249d9cef3e3 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.
+ */
+ function onAppListDoodleUpdated(data, base_url) {
+ var defaultLogo = $('default_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
« no previous file with comments | « chrome/browser/resources/app_list/start_page.html ('k') | chrome/browser/ui/app_list/start_page_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698