Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / resources / local_ntp / window_disposition_util.js
blob9282759560ec7501be5ad322bd27af1bc28940ab
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.
6 /**
7  * @fileoverview Utilities for handling window disposition.
8  */
11 /**
12  * The JavaScript button event value for a middle click.
13  * @type {number}
14  * @const
15  */
16 var MIDDLE_MOUSE_BUTTON = 1;
19 /**
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.
24  */
25 function getDispositionFromEvent(e) {
26   var middleButton = e.button == MIDDLE_MOUSE_BUTTON;
27   return chrome.embeddedSearch.newTabPage.getDispositionFromClick(middleButton,
28                                                                   e.altKey,
29                                                                   e.ctrlKey,
30                                                                   e.metaKey,
31                                                                   e.shiftKey);