| 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 */ | 293 */ |
| 294 var addTile = function(args) { | 294 var addTile = function(args) { |
| 295 if (args.rid) { | 295 if (args.rid) { |
| 296 var data = chrome.embeddedSearch.searchBox.getMostVisitedItemData(args.rid); | 296 var data = chrome.embeddedSearch.searchBox.getMostVisitedItemData(args.rid); |
| 297 data.tid = data.rid; | 297 data.tid = data.rid; |
| 298 if (!data.faviconUrl) { | 298 if (!data.faviconUrl) { |
| 299 data.faviconUrl = 'chrome-search://favicon/size/16@' + | 299 data.faviconUrl = 'chrome-search://favicon/size/16@' + |
| 300 window.devicePixelRatio + 'x/' + data.renderViewId + '/' + data.tid; | 300 window.devicePixelRatio + 'x/' + data.renderViewId + '/' + data.tid; |
| 301 } | 301 } |
| 302 tiles.appendChild(renderTile(data)); | 302 tiles.appendChild(renderTile(data)); |
| 303 logEvent(LOG_TYPE.NTP_CLIENT_SIDE_SUGGESTION); | |
| 304 } else if (args.id) { | 303 } else if (args.id) { |
| 305 tiles.appendChild(renderTile(args)); | 304 tiles.appendChild(renderTile(args)); |
| 306 logEvent(LOG_TYPE.NTP_SERVER_SIDE_SUGGESTION); | |
| 307 } else { | 305 } else { |
| 308 tiles.appendChild(renderTile(null)); | 306 tiles.appendChild(renderTile(null)); |
| 309 } | 307 } |
| 310 }; | 308 }; |
| 311 | 309 |
| 312 | 310 |
| 313 /** | 311 /** |
| 314 * Called when the user decided to add a tile to the blacklist. | 312 * Called when the user decided to add a tile to the blacklist. |
| 315 * It sets of the animation for the blacklist and sends the blacklisted id | 313 * It sets of the animation for the blacklist and sends the blacklisted id |
| 316 * to the host page. | 314 * to the host page. |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 var html = document.querySelector('html'); | 630 var html = document.querySelector('html'); |
| 633 html.dir = 'rtl'; | 631 html.dir = 'rtl'; |
| 634 } | 632 } |
| 635 | 633 |
| 636 window.addEventListener('message', handlePostMessage); | 634 window.addEventListener('message', handlePostMessage); |
| 637 }; | 635 }; |
| 638 | 636 |
| 639 | 637 |
| 640 window.addEventListener('DOMContentLoaded', init); | 638 window.addEventListener('DOMContentLoaded', init); |
| 641 })(); | 639 })(); |
| OLD | NEW |