Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 var chrome; | 5 var chrome; |
| 6 if (!chrome) | 6 if (!chrome) |
| 7 chrome = {}; | 7 chrome = {}; |
| 8 | 8 |
| 9 if (!chrome.embeddedSearch) { | 9 if (!chrome.embeddedSearch) { |
| 10 chrome.embeddedSearch = new function() { | 10 chrome.embeddedSearch = new function() { |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 251 native function GetThemeBackgroundInfo(); | 251 native function GetThemeBackgroundInfo(); |
| 252 native function DeleteMostVisitedItem(); | 252 native function DeleteMostVisitedItem(); |
| 253 native function UndoAllMostVisitedDeletions(); | 253 native function UndoAllMostVisitedDeletions(); |
| 254 native function UndoMostVisitedDeletion(); | 254 native function UndoMostVisitedDeletion(); |
| 255 native function NavigateNewTabPage(); | 255 native function NavigateNewTabPage(); |
| 256 native function IsInputInProgress(); | 256 native function IsInputInProgress(); |
| 257 | 257 |
| 258 function GetMostVisitedItemsWrapper() { | 258 function GetMostVisitedItemsWrapper() { |
| 259 var mostVisitedItems = GetMostVisitedItems(); | 259 var mostVisitedItems = GetMostVisitedItems(); |
| 260 for (var i = 0, item; item = mostVisitedItems[i]; ++i) { | 260 for (var i = 0, item; item = mostVisitedItems[i]; ++i) { |
| 261 item.faviconUrl = UpdateFaviconUrl(item.renderViewId, item.rid); | |
| 261 // These properties are private data and should not be returned to | 262 // These properties are private data and should not be returned to |
| 262 // the page. They are only accessible via getMostVisitedItemData(). | 263 // the page. They are only accessible via getMostVisitedItemData(). |
| 263 item.url = null; | 264 item.url = null; |
| 264 item.title = null; | 265 item.title = null; |
| 265 item.domain = null; | 266 item.domain = null; |
| 266 item.direction = null; | 267 item.direction = null; |
| 268 item.renderViewId = null; | |
|
samarth
2013/06/20 00:31:29
Might as well also delete item.rid since that's no
pedro (no code reviews)
2013/06/20 22:43:45
As discussed offline, we actually need the rid, so
| |
| 267 } | 269 } |
| 268 return mostVisitedItems; | 270 return mostVisitedItems; |
| 269 } | 271 } |
| 270 | 272 |
| 273 function UpdateFaviconUrl(renderViewId, rid) { | |
|
samarth
2013/06/20 00:31:29
CreateFaviconUrl or ConstructFaviconUrl
pedro (no code reviews)
2013/06/20 22:43:45
Renamed to GenerateThumbnailURL to keep consistenc
| |
| 274 return "chrome-search://favicon/size/16@" + | |
| 275 window.devicePixelRatio + "x/" + | |
| 276 renderViewId + "/" + rid; | |
| 277 } | |
| 278 | |
| 271 // ======================================================================= | 279 // ======================================================================= |
| 272 // Exported functions | 280 // Exported functions |
| 273 // ======================================================================= | 281 // ======================================================================= |
| 274 this.__defineGetter__('mostVisited', GetMostVisitedItemsWrapper); | 282 this.__defineGetter__('mostVisited', GetMostVisitedItemsWrapper); |
| 275 this.__defineGetter__('themeBackgroundInfo', GetThemeBackgroundInfo); | 283 this.__defineGetter__('themeBackgroundInfo', GetThemeBackgroundInfo); |
| 276 this.__defineGetter__('isInputInProgress', IsInputInProgress); | 284 this.__defineGetter__('isInputInProgress', IsInputInProgress); |
| 277 | 285 |
| 278 this.deleteMostVisitedItem = function(restrictedId) { | 286 this.deleteMostVisitedItem = function(restrictedId) { |
| 279 DeleteMostVisitedItem(restrictedId); | 287 DeleteMostVisitedItem(restrictedId); |
| 280 }; | 288 }; |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 292 this.onthemechange = null; | 300 this.onthemechange = null; |
| 293 this.oninputstart = null; | 301 this.oninputstart = null; |
| 294 this.oninputcancel = null; | 302 this.oninputcancel = null; |
| 295 }; | 303 }; |
| 296 | 304 |
| 297 // Export legacy searchbox API. | 305 // Export legacy searchbox API. |
| 298 // TODO: Remove this when Instant Extended is fully launched. | 306 // TODO: Remove this when Instant Extended is fully launched. |
| 299 chrome.searchBox = this.searchBox; | 307 chrome.searchBox = this.searchBox; |
| 300 }; | 308 }; |
| 301 } | 309 } |
| OLD | NEW |