summaryrefslogtreecommitdiffstats
path: root/chromium/chrome/browser/resources/local_ntp/local_ntp.js
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/chrome/browser/resources/local_ntp/local_ntp.js')
-rw-r--r--chromium/chrome/browser/resources/local_ntp/local_ntp.js30
1 files changed, 5 insertions, 25 deletions
diff --git a/chromium/chrome/browser/resources/local_ntp/local_ntp.js b/chromium/chrome/browser/resources/local_ntp/local_ntp.js
index 013cb0e20ac..fb8b8732166 100644
--- a/chromium/chrome/browser/resources/local_ntp/local_ntp.js
+++ b/chromium/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