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

Side by Side Diff: chrome/browser/resources/local_ntp/most_visited_single.js

Issue 1908363002: Nuke chrome.embeddedeseach.newTabPage.navigateContentWindow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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 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 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 if (data.pingUrl) { 417 if (data.pingUrl) {
418 tile.addEventListener('click', function(ev) { 418 tile.addEventListener('click', function(ev) {
419 navigator.sendBeacon(data.pingUrl); 419 navigator.sendBeacon(data.pingUrl);
420 }); 420 });
421 } 421 }
422 422
423 tile.addEventListener('click', function(ev) { 423 tile.addEventListener('click', function(ev) {
424 if (data.provider) { 424 if (data.provider) {
425 logMostVisitedNavigation(position, data.provider); 425 logMostVisitedNavigation(position, data.provider);
426 } 426 }
427
428 // For local suggestions, we use navigateContentWindow instead of the
429 // default action, since it includes support for file:// urls.
430 if (data.rid) {
431 ev.preventDefault();
432 var disp = chrome.embeddedSearch.newTabPage.getDispositionFromClick(
433 ev.button == 1, // MIDDLE BUTTON
434 ev.altKey, ev.ctrlKey, ev.metaKey, ev.shiftKey);
435
436 window.chrome.embeddedSearch.newTabPage.navigateContentWindow(data.rid,
437 disp);
438 }
439 }); 427 });
440 428
441 tile.addEventListener('keydown', function(event) { 429 tile.addEventListener('keydown', function(event) {
442 if (event.keyCode == 46 /* DELETE */ || 430 if (event.keyCode == 46 /* DELETE */ ||
443 event.keyCode == 8 /* BACKSPACE */) { 431 event.keyCode == 8 /* BACKSPACE */) {
444 event.preventDefault(); 432 event.preventDefault();
445 event.stopPropagation(); 433 event.stopPropagation();
446 blacklistTile(this); 434 blacklistTile(this);
447 } else if (event.keyCode == 13 /* ENTER */ || 435 } else if (event.keyCode == 13 /* ENTER */ ||
448 event.keyCode == 32 /* SPACE */) { 436 event.keyCode == 32 /* SPACE */) {
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 var html = document.querySelector('html'); 645 var html = document.querySelector('html');
658 html.dir = 'rtl'; 646 html.dir = 'rtl';
659 } 647 }
660 648
661 window.addEventListener('message', handlePostMessage); 649 window.addEventListener('message', handlePostMessage);
662 }; 650 };
663 651
664 652
665 window.addEventListener('DOMContentLoaded', init); 653 window.addEventListener('DOMContentLoaded', init);
666 })(); 654 })();
OLDNEW
« no previous file with comments | « chrome/browser/browser_resources.grd ('k') | chrome/browser/resources/local_ntp/most_visited_util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698