1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
7 * @fileoverview Utilities for handling window disposition.
12 * The JavaScript button event value for a middle click.
16 var MIDDLE_MOUSE_BUTTON = 1;
20 * Gets the desired navigation behavior from a event. This function works both
21 * with mouse and keyboard events.
22 * @param {Event} e The event object.
23 * @return {WindowOpenDisposition} The desired navigation behavior.
25 function getDispositionFromEvent(e) {
26 var middleButton = e.button == MIDDLE_MOUSE_BUTTON;
27 return chrome.embeddedSearch.newTabPage.getDispositionFromClick(middleButton,