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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* Copyright 2014 The Chromium Authors. All rights reserved. 1 /* Copyright 2014 The Chromium Authors. All rights reserved.
2 Use of this source code is governed by a BSD-style license that can be 2 Use of this source code is governed by a BSD-style license that can be
3 found in the LICENSE file. 3 found in the LICENSE file.
4 */ 4 */
5 5
6 <include src="../../../../ui/webui/resources/js/util.js">
7 <include src="../../../../ui/webui/resources/js/load_time_data.js">
8
6 /** 9 /**
7 * On load, registers the handler to add the 'hide' class to the container 10 * Once the DOM is loaded, determine if the header image is to be kept and
8 * element in order to hide it. 11 * register a handler to add the 'hide' class to the container element in order
12 * to hide it.
9 */ 13 */
10 window.onload = function() { 14 document.addEventListener('DOMContentLoaded', function(event) {
15 if (config['hideHeader']) {
16 $('container').removeChild($('header-image'));
17 }
11 $('optin-label').addEventListener('click', function() { 18 $('optin-label').addEventListener('click', function() {
12 $('container').classList.add('hide'); 19 $('container').classList.add('hide');
13 }); 20 });
14 }; 21 });
15 22
16 /** 23 /**
17 * Returns the height of the content. Method called from Chrome to properly size 24 * Returns the height of the content. Method called from Chrome to properly size
18 * the view embedding it. 25 * the view embedding it.
19 * @return {number} The height of the content, in pixels. 26 * @return {number} The height of the content, in pixels.
20 */ 27 */
21 function getContentHeight() { 28 function getContentHeight() {
22 return $('container').clientHeight; 29 return $('container').clientHeight;
23 } 30 }
OLDNEW
« 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