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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 | 66 |
67 /** | 67 /** |
68 * Number of lines to display in titles. | 68 * Number of lines to display in titles. |
69 * @type {number} | 69 * @type {number} |
70 */ | 70 */ |
71 var NUM_TITLE_LINES = 1; | 71 var NUM_TITLE_LINES = 1; |
72 | 72 |
73 | 73 |
74 /** | 74 /** |
75 * The origin of this request. | 75 * The origin of this request, i.e. 'https://www.google.TLD' for the remote NTP, |
| 76 * or 'chrome-search://local-ntp' for the local NTP. |
76 * @const {string} | 77 * @const {string} |
77 */ | 78 */ |
78 var DOMAIN_ORIGIN = '{{ORIGIN}}'; | 79 var DOMAIN_ORIGIN = '{{ORIGIN}}'; |
79 | 80 |
80 | 81 |
81 /** | 82 /** |
82 * Counter for DOM elements that we are waiting to finish loading. Starts out | 83 * Counter for DOM elements that we are waiting to finish loading. Starts out |
83 * at 1 because initially we're waiting for the "show" message from the parent. | 84 * at 1 because initially we're waiting for the "show" message from the parent. |
84 * @type {number} | 85 * @type {number} |
85 */ | 86 */ |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 var html = document.querySelector('html'); | 548 var html = document.querySelector('html'); |
548 html.dir = 'rtl'; | 549 html.dir = 'rtl'; |
549 } | 550 } |
550 | 551 |
551 window.addEventListener('message', handlePostMessage); | 552 window.addEventListener('message', handlePostMessage); |
552 }; | 553 }; |
553 | 554 |
554 | 555 |
555 window.addEventListener('DOMContentLoaded', init); | 556 window.addEventListener('DOMContentLoaded', init); |
556 })(); | 557 })(); |
OLD | NEW |