| Index: chrome/browser/resources/ntp4/apps_page.js
|
| diff --git a/chrome/browser/resources/ntp4/apps_page.js b/chrome/browser/resources/ntp4/apps_page.js
|
| index fd983250373cc575a49aa7e6cf95bfe5ee517e88..6848f57466d7b4c50eeb8b187e9d1c1d565f2acf 100644
|
| --- a/chrome/browser/resources/ntp4/apps_page.js
|
| +++ b/chrome/browser/resources/ntp4/apps_page.js
|
| @@ -21,7 +21,7 @@ cr.define('ntp', function() {
|
| SAME_APPS_PANE: 0,
|
| OTHER_APPS_PANE: 1,
|
| MOST_VISITED_PANE: 2, // Deprecated.
|
| - BOOKMARKS_PANE: 3, // Deprecated.
|
| + BOOKMARKS_PANE: 3, // Deprecated.
|
| OUTSIDE_NTP: 4
|
| };
|
| var DRAG_SOURCE_LIMIT = DRAG_SOURCE.OUTSIDE_NTP + 1;
|
| @@ -56,8 +56,8 @@ cr.define('ntp', function() {
|
|
|
| var self = this;
|
| this.forAllLaunchTypes_(function(launchTypeButton, id) {
|
| - launchTypeButton.addEventListener('activate',
|
| - self.onLaunchTypeChanged_.bind(self));
|
| + launchTypeButton.addEventListener(
|
| + 'activate', self.onLaunchTypeChanged_.bind(self));
|
| });
|
|
|
| this.launchTypeMenuSeparator_ = cr.ui.MenuItem.createSeparator();
|
| @@ -67,18 +67,18 @@ cr.define('ntp', function() {
|
|
|
| if (loadTimeData.getBoolean('canShowAppInfoDialog')) {
|
| this.appinfo_ = this.appendMenuItem_('appinfodialog');
|
| - this.appinfo_.addEventListener('activate',
|
| - this.onShowAppInfo_.bind(this));
|
| + this.appinfo_.addEventListener(
|
| + 'activate', this.onShowAppInfo_.bind(this));
|
| } else {
|
| this.details_ = this.appendMenuItem_('appdetails');
|
| - this.details_.addEventListener('activate',
|
| - this.onShowDetails_.bind(this));
|
| + this.details_.addEventListener(
|
| + 'activate', this.onShowDetails_.bind(this));
|
| }
|
|
|
| - this.options_.addEventListener('activate',
|
| - this.onShowOptions_.bind(this));
|
| - this.uninstall_.addEventListener('activate',
|
| - this.onUninstall_.bind(this));
|
| + this.options_.addEventListener(
|
| + 'activate', this.onShowOptions_.bind(this));
|
| + this.uninstall_.addEventListener(
|
| + 'activate', this.onUninstall_.bind(this));
|
|
|
| if (!cr.isChromeOS) {
|
| this.createShortcutSeparator_ =
|
| @@ -113,10 +113,10 @@ cr.define('ntp', function() {
|
| */
|
| forAllLaunchTypes_: function(f) {
|
| // Order matters: index matches launchType id.
|
| - var launchTypes = [this.launchPinnedTab_,
|
| - this.launchRegularTab_,
|
| - this.launchFullscreen_,
|
| - this.launchNewWindow_];
|
| + var launchTypes = [
|
| + this.launchPinnedTab_, this.launchRegularTab_, this.launchFullscreen_,
|
| + this.launchNewWindow_
|
| + ];
|
|
|
| for (var i = 0; i < launchTypes.length; ++i) {
|
| if (!launchTypes[i])
|
| @@ -150,7 +150,8 @@ cr.define('ntp', function() {
|
| launchTypeButton == launchTypeWindow) ||
|
| (loadTimeData.getBoolean('enableNewBookmarkApps') &&
|
| launchTypeButton != launchTypeWindow);
|
| - if (!launchTypeButton.hidden) hasLaunchType = true;
|
| + if (!launchTypeButton.hidden)
|
| + hasLaunchType = true;
|
| });
|
|
|
| this.launchTypeMenuSeparator_.hidden =
|
| @@ -186,7 +187,8 @@ cr.define('ntp', function() {
|
| // open as window and open as tab.
|
| if (loadTimeData.getBoolean('enableNewBookmarkApps')) {
|
| targetLaunchType = this.launchNewWindow_.checked ?
|
| - this.launchRegularTab_ : this.launchNewWindow_;
|
| + this.launchRegularTab_ :
|
| + this.launchNewWindow_;
|
| }
|
| this.forAllLaunchTypes_(function(launchTypeButton, id) {
|
| if (launchTypeButton == targetLaunchType) {
|
| @@ -249,8 +251,8 @@ cr.define('ntp', function() {
|
| this.appContents_.id = '';
|
| this.appendChild(this.appContents_);
|
|
|
| - this.appImgContainer_ = /** @type {HTMLElement} */(
|
| - this.querySelector('.app-img-container'));
|
| + this.appImgContainer_ =
|
| + /** @type {HTMLElement} */ (this.querySelector('.app-img-container'));
|
| this.appImg_ = this.appImgContainer_.querySelector('img');
|
| this.setIcon();
|
|
|
| @@ -259,7 +261,7 @@ cr.define('ntp', function() {
|
|
|
| // The app's full name is shown in the tooltip, whereas the short name
|
| // is used for the label.
|
| - var appSpan = /** @type {HTMLElement} */(
|
| + var appSpan = /** @type {HTMLElement} */ (
|
| this.appContents_.querySelector('.title'));
|
| appSpan.textContent = this.appData_.title;
|
| appSpan.title = this.appData_.full_name;
|
| @@ -276,8 +278,8 @@ cr.define('ntp', function() {
|
| });
|
|
|
| if (!this.appData_.kioskMode) {
|
| - this.appContents_.addEventListener('contextmenu',
|
| - cr.ui.contextMenuHandler);
|
| + this.appContents_.addEventListener(
|
| + 'contextmenu', cr.ui.contextMenuHandler);
|
| }
|
|
|
| this.addEventListener('mousedown', this.onMousedown_, true);
|
| @@ -359,12 +361,13 @@ cr.define('ntp', function() {
|
| * @private
|
| */
|
| onClick_: function(e) {
|
| - if (/** @type {MouseEvent} */(e).button > 1)
|
| + if (/** @type {MouseEvent} */ (e).button > 1)
|
| return;
|
|
|
| - chrome.send('launchApp',
|
| - [this.appId, APP_LAUNCH.NTP_APPS_MAXIMIZED, 'chrome-ntp-icon',
|
| - e.button, e.altKey, e.ctrlKey, e.metaKey, e.shiftKey]);
|
| + chrome.send('launchApp', [
|
| + this.appId, APP_LAUNCH.NTP_APPS_MAXIMIZED, 'chrome-ntp-icon', e.button,
|
| + e.altKey, e.ctrlKey, e.metaKey, e.shiftKey
|
| + ]);
|
|
|
| // Don't allow the click to trigger a link or anything
|
| e.preventDefault();
|
| @@ -377,9 +380,10 @@ cr.define('ntp', function() {
|
| */
|
| onKeydown_: function(e) {
|
| if (e.key == 'Enter') {
|
| - chrome.send('launchApp',
|
| - [this.appId, APP_LAUNCH.NTP_APPS_MAXIMIZED, '',
|
| - 0, e.altKey, e.ctrlKey, e.metaKey, e.shiftKey]);
|
| + chrome.send('launchApp', [
|
| + this.appId, APP_LAUNCH.NTP_APPS_MAXIMIZED, '', 0, e.altKey, e.ctrlKey,
|
| + e.metaKey, e.shiftKey
|
| + ]);
|
| e.preventDefault();
|
| e.stopPropagation();
|
| }
|
| @@ -413,8 +417,8 @@ cr.define('ntp', function() {
|
| e.preventDefault();
|
|
|
| if (e.button == 2 ||
|
| - !findAncestorByClass(/** @type {Element} */(e.target),
|
| - 'launch-click-target')) {
|
| + !findAncestorByClass(
|
| + /** @type {Element} */ (e.target), 'launch-click-target')) {
|
| this.appContents_.classList.add('suppress-active');
|
| } else {
|
| this.appContents_.classList.remove('suppress-active');
|
| @@ -439,10 +443,16 @@ cr.define('ntp', function() {
|
| * The data and preferences for this app.
|
| * @type {Object}
|
| */
|
| - set appData(data) { this.appData_ = data; },
|
| - get appData() { return this.appData_; },
|
| + set appData(data) {
|
| + this.appData_ = data;
|
| + },
|
| + get appData() {
|
| + return this.appData_;
|
| + },
|
|
|
| - get appId() { return this.appData_.id; },
|
| + get appId() {
|
| + return this.appData_.id;
|
| + },
|
|
|
| /**
|
| * Returns a pointer to the context menu for this app. All apps share the
|
| @@ -461,7 +471,9 @@ cr.define('ntp', function() {
|
| * the user can drag it onto the trash and expect something to happen).
|
| * @return {boolean} True if the app can be uninstalled.
|
| */
|
| - canBeRemoved: function() { return this.appData_.mayDisable; },
|
| + canBeRemoved: function() {
|
| + return this.appData_.mayDisable;
|
| + },
|
|
|
| /**
|
| * Uninstalls the app after it's been dropped on the trash.
|
| @@ -612,8 +624,8 @@ cr.define('ntp', function() {
|
| return true;
|
| if (!e.dataTransfer || !e.dataTransfer.types)
|
| return false;
|
| - return Array.prototype.indexOf.call(e.dataTransfer.types,
|
| - 'text/uri-list') != -1;
|
| + return Array.prototype.indexOf.call(
|
| + e.dataTransfer.types, 'text/uri-list') != -1;
|
| },
|
|
|
| /** @override */
|
| @@ -627,8 +639,8 @@ cr.define('ntp', function() {
|
| var samePageDrag = originalPage == this;
|
| sourceId = samePageDrag ? DRAG_SOURCE.SAME_APPS_PANE :
|
| DRAG_SOURCE.OTHER_APPS_PANE;
|
| - this.tileGrid_.insertBefore(currentlyDraggingTile,
|
| - this.tileElements_[index]);
|
| + this.tileGrid_.insertBefore(
|
| + currentlyDraggingTile, this.tileElements_[index]);
|
| this.tileMoved(currentlyDraggingTile);
|
| if (!samePageDrag) {
|
| originalPage.fireRemovedEvent(currentlyDraggingTile, index, true);
|
| @@ -641,7 +653,8 @@ cr.define('ntp', function() {
|
| }
|
|
|
| assert(sourceId != -1);
|
| - chrome.send('metricsHandler:recordInHistogram',
|
| + chrome.send(
|
| + 'metricsHandler:recordInHistogram',
|
| ['NewTabPage.AppsPageDragSource', sourceId, DRAG_SOURCE_LIMIT]);
|
| },
|
|
|
|
|