OLD | NEW |
1 /* Copyright 2015 The Chromium Authors. All rights reserved. | 1 /* Copyright 2015 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 // Single iframe for NTP tiles. | 5 // Single iframe for NTP tiles. |
6 (function() { | 6 (function() { |
7 'use strict'; | 7 'use strict'; |
8 | 8 |
9 | 9 |
10 /** | 10 /** |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 | 50 |
51 /** | 51 /** |
52 * Number of lines to display in titles. | 52 * Number of lines to display in titles. |
53 * @type {number} | 53 * @type {number} |
54 */ | 54 */ |
55 var NUM_TITLE_LINES = 1; | 55 var NUM_TITLE_LINES = 1; |
56 | 56 |
57 | 57 |
58 /** | 58 /** |
59 * The origin of this request. | 59 * The origin of this request, i.e. 'https://www.google.TLD' for the remote NTP, |
| 60 * or 'chrome-search://local-ntp' for the local NTP. |
60 * @const {string} | 61 * @const {string} |
61 */ | 62 */ |
62 var DOMAIN_ORIGIN = '{{ORIGIN}}'; | 63 var DOMAIN_ORIGIN = '{{ORIGIN}}'; |
63 | 64 |
64 | 65 |
65 /** | 66 /** |
66 * Counter for DOM elements that we are waiting to finish loading. Starts out | 67 * Counter for DOM elements that we are waiting to finish loading. Starts out |
67 * at 1 because initially we're waiting for the "show" message from the parent. | 68 * at 1 because initially we're waiting for the "show" message from the parent. |
68 * @type {number} | 69 * @type {number} |
69 */ | 70 */ |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 var html = document.querySelector('html'); | 514 var html = document.querySelector('html'); |
514 html.dir = 'rtl'; | 515 html.dir = 'rtl'; |
515 } | 516 } |
516 | 517 |
517 window.addEventListener('message', handlePostMessage); | 518 window.addEventListener('message', handlePostMessage); |
518 }; | 519 }; |
519 | 520 |
520 | 521 |
521 window.addEventListener('DOMContentLoaded', init); | 522 window.addEventListener('DOMContentLoaded', init); |
522 })(); | 523 })(); |
OLD | NEW |