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

Unified Diff: chrome/browser/resources/contextual_search/promo.js

Issue 587803003: [Search] Add a header image to the promo flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits 2 Created 6 years, 3 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/contextual_search/promo.js
diff --git a/chrome/browser/resources/contextual_search/promo.js b/chrome/browser/resources/contextual_search/promo.js
index 1168db2f0dbd256e702db48191900283f6e7973a..616acac3b8de16f77dd6c2d4dbb25a7116ec3a86 100644
--- a/chrome/browser/resources/contextual_search/promo.js
+++ b/chrome/browser/resources/contextual_search/promo.js
@@ -3,15 +3,22 @@
found in the LICENSE file.
*/
+<include src="../../../../ui/webui/resources/js/util.js">
+<include src="../../../../ui/webui/resources/js/load_time_data.js">
+
/**
- * On load, registers the handler to add the 'hide' class to the container
- * element in order to hide it.
+ * Once the DOM is loaded, determine if the header image is to be kept and
+ * register a handler to add the 'hide' class to the container element in order
+ * to hide it.
*/
-window.onload = function() {
+document.addEventListener('DOMContentLoaded', function(event) {
+ if (config['hideHeader']) {
+ $('container').removeChild($('header-image'));
+ }
$('optin-label').addEventListener('click', function() {
$('container').classList.add('hide');
});
-};
+});
/**
* Returns the height of the content. Method called from Chrome to properly size
« no previous file with comments | « chrome/browser/resources/contextual_search/promo.html ('k') | chrome/browser/search/contextual_search_promo_source_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698