Chromium Code Reviews| 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 <include src="../uber/uber_utils.js"> | 5 <include src="../uber/uber_utils.js"> |
| 6 | 6 |
| 7 /////////////////////////////////////////////////////////////////////////////// | 7 /////////////////////////////////////////////////////////////////////////////// |
| 8 // Globals: | 8 // Globals: |
| 9 /** @const */ var RESULTS_PER_PAGE = 150; | 9 /** @const */ var RESULTS_PER_PAGE = 150; |
| 10 /** @const */ var MAX_SEARCH_DEPTH_MONTHS = 18; | 10 /** @const */ var MAX_SEARCH_DEPTH_MONTHS = 18; |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 213 node.appendChild(document.createTextNode(content.slice(i))); | 213 node.appendChild(document.createTextNode(content.slice(i))); |
| 214 }; | 214 }; |
| 215 | 215 |
| 216 /** | 216 /** |
| 217 * @return {DOMObject} DOM representation for the title block. | 217 * @return {DOMObject} DOM representation for the title block. |
| 218 * @private | 218 * @private |
| 219 */ | 219 */ |
| 220 Visit.prototype.getTitleDOM_ = function() { | 220 Visit.prototype.getTitleDOM_ = function() { |
| 221 var node = createElementWithClassName('div', 'title'); | 221 var node = createElementWithClassName('div', 'title'); |
| 222 node.style.backgroundImage = | 222 node.style.backgroundImage = |
| 223 'url(chrome://favicon/' + encodeURIForCSS(this.url_) + ')'; | 223 'url(chrome://favicon/size/16@' + window.devicePixelRatio + 'x/' + |
|
Evan Stade
2012/09/18 13:54:05
could you put this in util.js? something like GetF
kevers
2012/09/18 17:31:03
Done.
| |
| 224 encodeURIForCSS(this.url_) + ')'; | |
| 225 node.style.backgroundSize = '16px'; | |
| 224 | 226 |
| 225 var link = document.createElement('a'); | 227 var link = document.createElement('a'); |
| 226 link.href = this.url_; | 228 link.href = this.url_; |
| 227 link.id = 'id-' + this.id_; | 229 link.id = 'id-' + this.id_; |
| 228 link.target = '_top'; | 230 link.target = '_top'; |
| 229 | 231 |
| 230 // Add a tooltip, since it might be ellipsized. | 232 // Add a tooltip, since it might be ellipsized. |
| 231 // TODO(dubroy): Find a way to show the tooltip only when necessary. | 233 // TODO(dubroy): Find a way to show the tooltip only when necessary. |
| 232 link.title = this.title_; | 234 link.title = this.title_; |
| 233 | 235 |
| (...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1167 historyView.reload(); | 1169 historyView.reload(); |
| 1168 } | 1170 } |
| 1169 | 1171 |
| 1170 // Add handlers to HTML elements. | 1172 // Add handlers to HTML elements. |
| 1171 document.addEventListener('DOMContentLoaded', load); | 1173 document.addEventListener('DOMContentLoaded', load); |
| 1172 | 1174 |
| 1173 // This event lets us enable and disable menu items before the menu is shown. | 1175 // This event lets us enable and disable menu items before the menu is shown. |
| 1174 document.addEventListener('canExecute', function(e) { | 1176 document.addEventListener('canExecute', function(e) { |
| 1175 e.canExecute = true; | 1177 e.canExecute = true; |
| 1176 }); | 1178 }); |
| OLD | NEW |