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

Unified Diff: chrome/browser/resources/local_ntp/local_ntp.js

Issue 178253008: Redoing Issue 36073011: Allowing file:/// in Instant Extended's Most Visited links. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unused consts. Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/local_ntp/local_ntp.js
diff --git a/chrome/browser/resources/local_ntp/local_ntp.js b/chrome/browser/resources/local_ntp/local_ntp.js
index 013cb0e20acf6dbab29b1969b5d4ea8785eab44f..fb8b873216619a004c19a623ce170a4cb6d0796b 100644
--- a/chrome/browser/resources/local_ntp/local_ntp.js
+++ b/chrome/browser/resources/local_ntp/local_ntp.js
@@ -7,13 +7,14 @@
* @fileoverview The local InstantExtended NTP.
*/
+
/**
* Controls rendering the new tab page for InstantExtended.
* @return {Object} A limited interface for testing the local NTP.
*/
function LocalNTP() {
<include src="../../../../ui/webui/resources/js/assert.js">
-
+<include src="window_disposition_util.js">
/**
@@ -101,16 +102,6 @@ var MIDDLE_MOUSE_BUTTON = 1;
/**
- * Possible behaviors for navigateContentWindow.
- * @enum {number}
- */
-var WindowOpenDisposition = {
- CURRENT_TAB: 1,
- NEW_BACKGROUND_TAB: 2
-};
-
-
-/**
* The container for the tile elements.
* @type {Element}
*/
@@ -542,8 +533,9 @@ function createTile(page, position) {
var rid = page.rid;
tileElement.classList.add(CLASSES.PAGE);
- var navigateFunction = function() {
- ntpApiHandle.navigateContentWindow(rid);
+ var navigateFunction = function(e) {
+ e.preventDefault();
+ ntpApiHandle.navigateContentWindow(rid, getDispositionFromEvent(e));
};
// The click handler for navigating to the page identified by the RID.
@@ -920,18 +912,6 @@ function getEmbeddedSearchApiHandle() {
return null;
}
-/**
- * Extract the desired navigation behavior from a click button.
- * @param {number} button The Event#button property of a click event.
- * @return {WindowOpenDisposition} The desired behavior for
- * navigateContentWindow.
- */
-function getDispositionFromClickButton(button) {
- if (button == MIDDLE_MOUSE_BUTTON)
- return WindowOpenDisposition.NEW_BACKGROUND_TAB;
- return WindowOpenDisposition.CURRENT_TAB;
-}
-
/**
* Prepares the New Tab Page by adding listeners, rendering the current

Powered by Google App Engine
This is Rietveld 408576698