OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('ntp', function() { | 5 cr.define('ntp', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 var APP_LAUNCH = { | 8 var APP_LAUNCH = { |
9 // The histogram buckets (keep in sync with extension_constants.h). | 9 // The histogram buckets (keep in sync with extension_constants.h). |
10 NTP_APPS_MAXIMIZED: 0, | 10 NTP_APPS_MAXIMIZED: 0, |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
383 this.style.top = toCssPx(y); | 383 this.style.top = toCssPx(y); |
384 }, | 384 }, |
385 | 385 |
386 onBlur_: function(e) { | 386 onBlur_: function(e) { |
387 this.classList.remove('click-focus'); | 387 this.classList.remove('click-focus'); |
388 this.appContents_.classList.remove('suppress-active'); | 388 this.appContents_.classList.remove('suppress-active'); |
389 }, | 389 }, |
390 | 390 |
391 /** | 391 /** |
392 * Invoked when an app is clicked. | 392 * Invoked when an app is clicked. |
393 * @param {MouseEvent} e The click/auxclick event. | 393 * @param {Event} e The click/auxclick event. |
dpapad
2016/09/15 17:39:03
Should this be !Event
| |
394 * @private | 394 * @private |
395 */ | 395 */ |
396 onClick_: function(e) { | 396 onClick_: function(e) { |
397 if (e.button > 1) return; | 397 if (/** @type {MouseEvent} */(e).button > 1) return; |
398 | 398 |
399 var url = !this.appData_.is_webstore ? '' : | 399 var url = !this.appData_.is_webstore ? '' : |
400 appendParam(this.appData_.url, | 400 appendParam(this.appData_.url, |
401 'utm_source', | 401 'utm_source', |
402 'chrome-ntp-icon'); | 402 'chrome-ntp-icon'); |
403 | 403 |
404 chrome.send('launchApp', | 404 chrome.send('launchApp', |
405 [this.appId, APP_LAUNCH.NTP_APPS_MAXIMIZED, url, | 405 [this.appId, APP_LAUNCH.NTP_APPS_MAXIMIZED, url, |
406 e.button, e.altKey, e.ctrlKey, e.metaKey, e.shiftKey]); | 406 e.button, e.altKey, e.ctrlKey, e.metaKey, e.shiftKey]); |
407 | 407 |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
774 chrome.send('launchApp', [appId, APP_LAUNCH.NTP_APP_RE_ENABLE]); | 774 chrome.send('launchApp', [appId, APP_LAUNCH.NTP_APP_RE_ENABLE]); |
775 } | 775 } |
776 | 776 |
777 return { | 777 return { |
778 APP_LAUNCH: APP_LAUNCH, | 778 APP_LAUNCH: APP_LAUNCH, |
779 App: App, | 779 App: App, |
780 AppsPage: AppsPage, | 780 AppsPage: AppsPage, |
781 launchAppAfterEnable: launchAppAfterEnable, | 781 launchAppAfterEnable: launchAppAfterEnable, |
782 }; | 782 }; |
783 }); | 783 }); |
OLD | NEW |