Commit df5e64aa authored by tsergeant's avatar tsergeant Committed by Commit bot

MD History: clang-format Javascript files (again!)

The clang-format Javascript style changed in crrev.com/440558 to prevent
single-line functions. This CL updates the Javascript in MD History to
follow this change.

BUG=567770
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2607653002
Cr-Commit-Position: refs/heads/master@{#440833}
parent 6ae3c143
......@@ -53,8 +53,12 @@ Polymer({
searchTerm: '',
groupedOffset: 0,
set range(val) { this._range = Number(val); },
get range() { return this._range; },
set range(val) {
this._range = Number(val);
},
get range() {
return this._range;
},
};
}
},
......@@ -86,7 +90,9 @@ Polymer({
showMenuPromo_: {
type: Boolean,
value: function() { return loadTimeData.getBoolean('showMenuPromo'); },
value: function() {
return loadTimeData.getBoolean('showMenuPromo');
},
},
// True if the window is narrow enough for the page to have a drawer.
......@@ -164,7 +170,9 @@ Polymer({
},
/** @private */
onCrToolbarMenuPromoClose_: function() { this.showMenuPromo_ = false; },
onCrToolbarMenuPromoClose_: function() {
this.showMenuPromo_ = false;
},
/** @private */
onCrToolbarMenuPromoShown_: function() {
......@@ -211,7 +219,9 @@ Polymer({
toolbar.count = 0;
},
deleteSelected: function() { this.$.history.deleteSelectedWithPrompt(); },
deleteSelected: function() {
this.$.history.deleteSelectedWithPrompt();
},
/**
* @param {HistoryQuery} info An object containing information about the
......@@ -230,7 +240,9 @@ Polymer({
/**
* Shows and focuses the search bar in the toolbar.
*/
focusToolbarSearchField: function() { this.$.toolbar.showSearchField(); },
focusToolbarSearchField: function() {
this.$.toolbar.showSearchField();
},
/**
* @param {Event} e
......@@ -276,7 +288,9 @@ Polymer({
/**
* Called when browsing data is cleared.
*/
historyDeleted: function() { this.$.history.historyDeleted(); },
historyDeleted: function() {
this.$.history.historyDeleted();
},
/**
* Update sign in state of synced device manager after user logs in or out.
......@@ -353,7 +367,9 @@ Polymer({
* @return {string}
* @private
*/
getSelectedPage_: function(selectedPage, items) { return selectedPage; },
getSelectedPage_: function(selectedPage, items) {
return selectedPage;
},
/** @private */
closeDrawer_: function() {
......
......@@ -24,7 +24,9 @@ cr.define('md_history', function() {
deleteItems: function(items) {
if (this.pendingDeleteItems_ != null) {
// There's already a deletion in progress, reject immediately.
return new Promise(function(resolve, reject) { reject(items); });
return new Promise(function(resolve, reject) {
reject(items);
});
}
var removalList = items.map(function(item) {
......@@ -45,7 +47,9 @@ cr.define('md_history', function() {
/**
* @param {!string} url
*/
removeBookmark: function(url) { chrome.send('removeBookmark', [url]); },
removeBookmark: function(url) {
chrome.send('removeBookmark', [url]);
},
/**
* @param {string} sessionTag
......@@ -74,7 +78,9 @@ cr.define('md_history', function() {
chrome.send('deleteForeignSession', [sessionTag]);
},
openClearBrowsingData: function() { chrome.send('clearBrowsingData'); },
openClearBrowsingData: function() {
chrome.send('clearBrowsingData');
},
/**
* @param {string} histogram
......@@ -114,7 +120,9 @@ cr.define('md_history', function() {
this.pendingDeletePromise_ = null;
},
menuPromoShown: function() { chrome.send('menuPromoShown'); },
menuPromoShown: function() {
chrome.send('menuPromoShown');
},
};
cr.addSingletonGetter(BrowserService);
......
......@@ -139,7 +139,9 @@ Polymer({
e.model.set('domain.rendered', true);
// Give the history-items time to render.
setTimeout(function() { collapse.toggle() }, 0);
setTimeout(function() {
collapse.toggle()
}, 0);
},
/**
......
......@@ -233,7 +233,9 @@ cr.define('md_history', function() {
* @return {string}
* @private
*/
getAriaChecked_: function(selected) { return selected ? 'true' : 'false'; },
getAriaChecked_: function(selected) {
return selected ? 'true' : 'false';
},
/**
* Remove bookmark of current item when bookmark-star is clicked.
......
......@@ -155,5 +155,7 @@ Polymer({
* @return {string}
* @private
*/
pathForItem_: function(index) { return 'historyData_.' + index; },
pathForItem_: function(index) {
return 'historyData_.' + index;
},
});
......@@ -35,7 +35,9 @@ var HistoryListBehavior = {
*/
selectedPaths: {
type: Object,
value: /** @return {!Set<string>} */ function() { return new Set(); },
value: /** @return {!Set<string>} */ function() {
return new Set();
},
},
lastSelectedPath: String,
......@@ -59,7 +61,9 @@ var HistoryListBehavior = {
* @return {boolean}
* @private
*/
hasResults: function(historyDataLength) { return historyDataLength > 0; },
hasResults: function(historyDataLength) {
return historyDataLength > 0;
},
/**
* @param {string} searchedTerm
......@@ -170,7 +174,9 @@ var HistoryListBehavior = {
var array = this.get(node.currentPath);
var splices = [];
node.indexes.sort(function(a, b) { return b - a; });
node.indexes.sort(function(a, b) {
return b - a;
});
node.indexes.forEach(function(index) {
if (node.leaf || this.removeItemsBeneathNode_(node.children[index])) {
var item = array.splice(index, 1)[0];
......
......@@ -83,14 +83,18 @@ Polymer({
.getSearchField();
},
showSearchField: function() { this.searchField.showAndFocus(); },
showSearchField: function() {
this.searchField.showAndFocus();
},
/**
* Changes the toolbar background color depending on whether any history items
* are currently selected.
* @private
*/
changeToolbarView_: function() { this.itemsSelected_ = this.count > 0; },
changeToolbarView_: function() {
this.itemsSelected_ = this.count > 0;
},
/**
* When changing the search term externally, update the search field to
......@@ -123,10 +127,14 @@ Polymer({
},
/** @private */
onClearSelectionTap_: function() { this.fire('unselect-all'); },
onClearSelectionTap_: function() {
this.fire('unselect-all');
},
/** @private */
onDeleteTap_: function() { this.fire('delete-selected'); },
onDeleteTap_: function() {
this.fire('delete-selected');
},
/**
* If the user is a supervised user the delete button is not shown.
......@@ -170,5 +178,7 @@ Polymer({
* @private
* @return {boolean}
*/
isToday_: function() { return this.groupedOffset == 0; },
isToday_: function() {
return this.groupedOffset == 0;
},
});
......@@ -114,7 +114,9 @@ Polymer({
},
/** @return {Element} */
getContentScrollTarget: function() { return this.getSelectedList_(); },
getContentScrollTarget: function() {
return this.getSelectedList_();
},
/** @return {number} */
getSelectedItemCount: function() {
......@@ -178,10 +180,14 @@ Polymer({
},
/** @private */
groupedOffsetChanged_: function() { this.queryHistory(false); },
groupedOffsetChanged_: function() {
this.queryHistory(false);
},
/** @private */
loadMoreHistory_: function() { this.queryHistory(true); },
loadMoreHistory_: function() {
this.queryHistory(true);
},
/**
* @param {HistoryQuery} info
......@@ -299,7 +305,9 @@ Polymer({
* @return {Element}
* @private
*/
getSelectedList_: function() { return this.$$('#' + this.selectedPage_); },
getSelectedList_: function() {
return this.$$('#' + this.selectedPage_);
},
/** @private */
canDeleteHistory_: function() {
......
......@@ -30,12 +30,16 @@ Polymer({
* @param {CustomEvent} e
* @private
*/
onSpacePressed_: function(e) { e.detail.keyboardEvent.path[0].click(); },
onSpacePressed_: function(e) {
e.detail.keyboardEvent.path[0].click();
},
/**
* @private
*/
onSelectorActivate_: function() { this.fire('history-close-drawer'); },
onSelectorActivate_: function() {
this.fire('history-close-drawer');
},
/**
* Relocates the user to the clear browsing data section of the settings page.
......@@ -55,5 +59,7 @@ Polymer({
* accessibility purposes, taps are handled separately by <iron-selector>.
* @private
*/
onItemClick_: function(e) { e.preventDefault(); },
onItemClick_: function(e) {
e.preventDefault();
},
});
......@@ -12,7 +12,9 @@ Polymer({
*/
tabs: {
type: Array,
value: function() { return []; },
value: function() {
return [];
},
observer: 'updateIcons_'
},
......
......@@ -36,7 +36,9 @@ Polymer({
*/
syncedDevices_: {
type: Array,
value: function() { return []; },
value: function() {
return [];
},
},
/** @private */
......@@ -87,10 +89,14 @@ Polymer({
},
/** @override */
detached: function() { this.focusGrid_.destroy(); },
detached: function() {
this.focusGrid_.destroy();
},
/** @return {HTMLElement} */
getContentScrollTarget: function() { return this; },
getContentScrollTarget: function() {
return this;
},
/**
* @param {!ForeignSession} session
......@@ -106,7 +112,9 @@ Polymer({
if (newTabs.length == 0)
continue;
newTabs.forEach(function(tab) { tab.windowId = windowId; });
newTabs.forEach(function(tab) {
tab.windowId = windowId;
});
var windowAdded = false;
if (!this.searchTerm) {
......@@ -138,7 +146,9 @@ Polymer({
},
/** @private */
onSignInTap_: function() { chrome.send('startSignInFlow'); },
onSignInTap_: function() {
chrome.send('startSignInFlow');
},
/** @private */
onOpenMenu_: function(e) {
......@@ -177,7 +187,9 @@ Polymer({
return prev.concat(cur.createFocusRows());
},
[])
.forEach(function(row) { this.focusGrid_.addRow(row); }.bind(this));
.forEach(function(row) {
this.focusGrid_.addRow(row);
}.bind(this));
this.focusGrid_.ensureRowActive();
});
},
......@@ -195,7 +207,9 @@ Polymer({
},
/** @private */
clearDisplayedSyncedDevices_: function() { this.syncedDevices_ = []; },
clearDisplayedSyncedDevices_: function() {
this.syncedDevices_ = [];
},
/**
* Decide whether or not should display no synced tabs message.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment