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 {Event} e The click/auxclick event. | 393 * @param {MouseEvent} e The click/auxclick event. |
394 * @private | 394 * @private |
395 */ | 395 */ |
396 onClick_: function(e) { | 396 onClick_: function(e) { |
| 397 if (e.button > 1) return; |
| 398 |
397 var url = !this.appData_.is_webstore ? '' : | 399 var url = !this.appData_.is_webstore ? '' : |
398 appendParam(this.appData_.url, | 400 appendParam(this.appData_.url, |
399 'utm_source', | 401 'utm_source', |
400 'chrome-ntp-icon'); | 402 'chrome-ntp-icon'); |
401 | 403 |
402 chrome.send('launchApp', | 404 chrome.send('launchApp', |
403 [this.appId, APP_LAUNCH.NTP_APPS_MAXIMIZED, url, | 405 [this.appId, APP_LAUNCH.NTP_APPS_MAXIMIZED, url, |
404 e.button, e.altKey, e.ctrlKey, e.metaKey, e.shiftKey]); | 406 e.button, e.altKey, e.ctrlKey, e.metaKey, e.shiftKey]); |
405 | 407 |
406 // Don't allow the click to trigger a link or anything | 408 // Don't allow the click to trigger a link or anything |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 chrome.send('launchApp', [appId, APP_LAUNCH.NTP_APP_RE_ENABLE]); | 774 chrome.send('launchApp', [appId, APP_LAUNCH.NTP_APP_RE_ENABLE]); |
773 } | 775 } |
774 | 776 |
775 return { | 777 return { |
776 APP_LAUNCH: APP_LAUNCH, | 778 APP_LAUNCH: APP_LAUNCH, |
777 App: App, | 779 App: App, |
778 AppsPage: AppsPage, | 780 AppsPage: AppsPage, |
779 launchAppAfterEnable: launchAppAfterEnable, | 781 launchAppAfterEnable: launchAppAfterEnable, |
780 }; | 782 }; |
781 }); | 783 }); |
OLD | NEW |