Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Side by Side Diff: chrome/browser/resources/history/history.js

Issue 617673002: history: fix closure compilation by fixing non-standardized use of setInterval(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: contextObj -> bind(this) Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <include src="../uber/uber_utils.js"> 5 <include src="../uber/uber_utils.js">
6 <include src="history_focus_manager.js"> 6 <include src="history_focus_manager.js">
7 7
8 /////////////////////////////////////////////////////////////////////////////// 8 ///////////////////////////////////////////////////////////////////////////////
9 // Globals: 9 // Globals:
10 /** @const */ var RESULTS_PER_PAGE = 150; 10 /** @const */ var RESULTS_PER_PAGE = 150;
(...skipping 1719 matching lines...) Expand 10 before | Expand all | Expand 10 after
1730 1730
1731 this.model = model; 1731 this.model = model;
1732 this.view = view; 1732 this.view = view;
1733 1733
1734 if (typeof this.checker_ != 'undefined' && this.checker_) { 1734 if (typeof this.checker_ != 'undefined' && this.checker_) {
1735 clearInterval(this.checker_); 1735 clearInterval(this.checker_);
1736 } 1736 }
1737 1737
1738 // TODO(glen): Replace this with a bound method so we don't need 1738 // TODO(glen): Replace this with a bound method so we don't need
1739 // public model and view. 1739 // public model and view.
1740 this.checker_ = window.setInterval(function(stateObj) { 1740 this.checker_ = window.setInterval(function() {
1741 var hashData = stateObj.getHashData(); 1741 var hashData = this.getHashData();
1742 var page = parseInt(hashData.page, 10); 1742 var page = parseInt(hashData.page, 10);
1743 var range = parseInt(hashData.range, 10); 1743 var range = parseInt(hashData.range, 10);
1744 var offset = parseInt(hashData.offset, 10); 1744 var offset = parseInt(hashData.offset, 10);
1745 if (hashData.q != stateObj.model.getSearchText() || 1745 if (hashData.q != this.model.getSearchText() ||
1746 page != stateObj.view.getPage() || 1746 page != this.view.getPage() ||
1747 range != stateObj.model.rangeInDays || 1747 range != this.model.rangeInDays ||
1748 offset != stateObj.model.offset) { 1748 offset != this.model.offset) {
1749 stateObj.view.setPageState(hashData.q, page, range, offset); 1749 this.view.setPageState(hashData.q, page, range, offset);
1750 } 1750 }
1751 }, 50, this); 1751 }.bind(this), 50);
1752 } 1752 }
1753 1753
1754 /** 1754 /**
1755 * Holds the singleton instance. 1755 * Holds the singleton instance.
1756 */ 1756 */
1757 PageState.instance = null; 1757 PageState.instance = null;
1758 1758
1759 /** 1759 /**
1760 * @return {Object} An object containing parameters from our window hash. 1760 * @return {Object} An object containing parameters from our window hash.
1761 */ 1761 */
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
2275 historyView.reload(); 2275 historyView.reload();
2276 } 2276 }
2277 2277
2278 // Add handlers to HTML elements. 2278 // Add handlers to HTML elements.
2279 document.addEventListener('DOMContentLoaded', load); 2279 document.addEventListener('DOMContentLoaded', load);
2280 2280
2281 // This event lets us enable and disable menu items before the menu is shown. 2281 // This event lets us enable and disable menu items before the menu is shown.
2282 document.addEventListener('canExecute', function(e) { 2282 document.addEventListener('canExecute', function(e) {
2283 e.canExecute = true; 2283 e.canExecute = true;
2284 }); 2284 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698