| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 native function GetThemeBackgroundInfo(); | 76 native function GetThemeBackgroundInfo(); |
| 77 native function IsInputInProgress(); | 77 native function IsInputInProgress(); |
| 78 native function LogEvent(); | 78 native function LogEvent(); |
| 79 native function NavigateContentWindow(); | 79 native function NavigateContentWindow(); |
| 80 native function UndoAllMostVisitedDeletions(); | 80 native function UndoAllMostVisitedDeletions(); |
| 81 native function UndoMostVisitedDeletion(); | 81 native function UndoMostVisitedDeletion(); |
| 82 | 82 |
| 83 function GetMostVisitedItemsWrapper() { | 83 function GetMostVisitedItemsWrapper() { |
| 84 var mostVisitedItems = GetMostVisitedItems(); | 84 var mostVisitedItems = GetMostVisitedItems(); |
| 85 for (var i = 0, item; item = mostVisitedItems[i]; ++i) { | 85 for (var i = 0, item; item = mostVisitedItems[i]; ++i) { |
| 86 item.faviconUrl = GenerateFaviconURL(item.renderViewId, item.rid); |
| 86 // These properties are private data and should not be returned to | 87 // These properties are private data and should not be returned to |
| 87 // the page. They are only accessible via getMostVisitedItemData(). | 88 // the page. They are only accessible via getMostVisitedItemData(). |
| 88 item.url = null; | 89 item.url = null; |
| 89 item.title = null; | 90 item.title = null; |
| 90 item.domain = null; | 91 item.domain = null; |
| 91 item.direction = null; | 92 item.direction = null; |
| 93 item.renderViewId = null; |
| 92 } | 94 } |
| 93 return mostVisitedItems; | 95 return mostVisitedItems; |
| 94 } | 96 } |
| 95 | 97 |
| 98 function GenerateFaviconURL(renderViewId, rid) { |
| 99 return "chrome-search://favicon/size/16@" + |
| 100 window.devicePixelRatio + "x/" + |
| 101 renderViewId + "/" + rid; |
| 102 } |
| 103 |
| 96 // ======================================================================= | 104 // ======================================================================= |
| 97 // Exported functions | 105 // Exported functions |
| 98 // ======================================================================= | 106 // ======================================================================= |
| 99 this.__defineGetter__('appLauncherEnabled', GetAppLauncherEnabled); | 107 this.__defineGetter__('appLauncherEnabled', GetAppLauncherEnabled); |
| 100 this.__defineGetter__('isInputInProgress', IsInputInProgress); | 108 this.__defineGetter__('isInputInProgress', IsInputInProgress); |
| 101 this.__defineGetter__('mostVisited', GetMostVisitedItemsWrapper); | 109 this.__defineGetter__('mostVisited', GetMostVisitedItemsWrapper); |
| 102 this.__defineGetter__('themeBackgroundInfo', GetThemeBackgroundInfo); | 110 this.__defineGetter__('themeBackgroundInfo', GetThemeBackgroundInfo); |
| 103 | 111 |
| 104 this.deleteMostVisitedItem = function(restrictedId) { | 112 this.deleteMostVisitedItem = function(restrictedId) { |
| 105 DeleteMostVisitedItem(restrictedId); | 113 DeleteMostVisitedItem(restrictedId); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 126 this.oninputcancel = null; | 134 this.oninputcancel = null; |
| 127 this.oninputstart = null; | 135 this.oninputstart = null; |
| 128 this.onmostvisitedchange = null; | 136 this.onmostvisitedchange = null; |
| 129 this.onthemechange = null; | 137 this.onthemechange = null; |
| 130 }; | 138 }; |
| 131 | 139 |
| 132 // TODO(jered): Remove when google no longer expects this object. | 140 // TODO(jered): Remove when google no longer expects this object. |
| 133 chrome.searchBox = this.searchBox; | 141 chrome.searchBox = this.searchBox; |
| 134 }; | 142 }; |
| 135 } | 143 } |
| OLD | NEW |