| 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 // ======================================================================= | 251 // ======================================================================= |
| 252 // Private functions | 252 // Private functions |
| 253 // ======================================================================= | 253 // ======================================================================= |
| 254 native function GetMostVisitedItems(); | 254 native function GetMostVisitedItems(); |
| 255 native function GetThemeBackgroundInfo(); | 255 native function GetThemeBackgroundInfo(); |
| 256 native function DeleteMostVisitedItem(); | 256 native function DeleteMostVisitedItem(); |
| 257 native function UndoAllMostVisitedDeletions(); | 257 native function UndoAllMostVisitedDeletions(); |
| 258 native function UndoMostVisitedDeletion(); | 258 native function UndoMostVisitedDeletion(); |
| 259 native function NavigateNewTabPage(); | 259 native function NavigateNewTabPage(); |
| 260 native function IsInputInProgress(); | 260 native function IsInputInProgress(); |
| 261 native function GetAppLauncherEnabled(); |
| 261 | 262 |
| 262 function GetMostVisitedItemsWrapper() { | 263 function GetMostVisitedItemsWrapper() { |
| 263 var mostVisitedItems = GetMostVisitedItems(); | 264 var mostVisitedItems = GetMostVisitedItems(); |
| 264 for (var i = 0, item; item = mostVisitedItems[i]; ++i) { | 265 for (var i = 0, item; item = mostVisitedItems[i]; ++i) { |
| 265 // These properties are private data and should not be returned to | 266 // These properties are private data and should not be returned to |
| 266 // the page. They are only accessible via getMostVisitedItemData(). | 267 // the page. They are only accessible via getMostVisitedItemData(). |
| 267 item.url = null; | 268 item.url = null; |
| 268 item.title = null; | 269 item.title = null; |
| 269 item.domain = null; | 270 item.domain = null; |
| 270 item.direction = null; | 271 item.direction = null; |
| 271 } | 272 } |
| 272 return mostVisitedItems; | 273 return mostVisitedItems; |
| 273 } | 274 } |
| 274 | 275 |
| 275 // ======================================================================= | 276 // ======================================================================= |
| 276 // Exported functions | 277 // Exported functions |
| 277 // ======================================================================= | 278 // ======================================================================= |
| 278 this.__defineGetter__('mostVisited', GetMostVisitedItemsWrapper); | 279 this.__defineGetter__('mostVisited', GetMostVisitedItemsWrapper); |
| 279 this.__defineGetter__('themeBackgroundInfo', GetThemeBackgroundInfo); | 280 this.__defineGetter__('themeBackgroundInfo', GetThemeBackgroundInfo); |
| 280 this.__defineGetter__('isInputInProgress', IsInputInProgress); | 281 this.__defineGetter__('isInputInProgress', IsInputInProgress); |
| 282 this.__defineGetter__('appLauncherEnabled', GetAppLauncherEnabled); |
| 281 | 283 |
| 282 this.deleteMostVisitedItem = function(restrictedId) { | 284 this.deleteMostVisitedItem = function(restrictedId) { |
| 283 DeleteMostVisitedItem(restrictedId); | 285 DeleteMostVisitedItem(restrictedId); |
| 284 }; | 286 }; |
| 285 this.undoAllMostVisitedDeletions = function() { | 287 this.undoAllMostVisitedDeletions = function() { |
| 286 UndoAllMostVisitedDeletions(); | 288 UndoAllMostVisitedDeletions(); |
| 287 }; | 289 }; |
| 288 this.undoMostVisitedDeletion = function(restrictedId) { | 290 this.undoMostVisitedDeletion = function(restrictedId) { |
| 289 UndoMostVisitedDeletion(restrictedId); | 291 UndoMostVisitedDeletion(restrictedId); |
| 290 }; | 292 }; |
| 291 this.navigateContentWindow = function(destination, disposition) { | 293 this.navigateContentWindow = function(destination, disposition) { |
| 292 NavigateNewTabPage(destination, disposition); | 294 NavigateNewTabPage(destination, disposition); |
| 293 } | 295 } |
| 294 | 296 |
| 295 this.onmostvisitedchange = null; | 297 this.onmostvisitedchange = null; |
| 296 this.onthemechange = null; | 298 this.onthemechange = null; |
| 297 this.oninputstart = null; | 299 this.oninputstart = null; |
| 298 this.oninputcancel = null; | 300 this.oninputcancel = null; |
| 299 }; | 301 }; |
| 300 | 302 |
| 301 // Export legacy searchbox API. | 303 // Export legacy searchbox API. |
| 302 // TODO: Remove this when Instant Extended is fully launched. | 304 // TODO: Remove this when Instant Extended is fully launched. |
| 303 chrome.searchBox = this.searchBox; | 305 chrome.searchBox = this.searchBox; |
| 304 }; | 306 }; |
| 305 } | 307 } |
| OLD | NEW |