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 // ======================================================================= | 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 LogEvent(); | |
| 262 | |
|
beaudoin
2013/06/22 01:14:53
Remove blank line.
annark1
2013/06/25 16:01:38
Done.
| |
| 261 | 263 |
| 262 function GetMostVisitedItemsWrapper() { | 264 function GetMostVisitedItemsWrapper() { |
| 263 var mostVisitedItems = GetMostVisitedItems(); | 265 var mostVisitedItems = GetMostVisitedItems(); |
| 264 for (var i = 0, item; item = mostVisitedItems[i]; ++i) { | 266 for (var i = 0, item; item = mostVisitedItems[i]; ++i) { |
| 265 // These properties are private data and should not be returned to | 267 // These properties are private data and should not be returned to |
| 266 // the page. They are only accessible via getMostVisitedItemData(). | 268 // the page. They are only accessible via getMostVisitedItemData(). |
| 267 item.url = null; | 269 item.url = null; |
| 268 item.title = null; | 270 item.title = null; |
| 269 item.domain = null; | 271 item.domain = null; |
| 270 item.direction = null; | 272 item.direction = null; |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 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 }; |
| 296 // This method is restricted to chrome-search://most-visited pages by | |
| 297 // checking the invoking context's origin in searchbox_extension.cc. | |
| 298 this.logEvent = function(name, value, opt_boundary, opt_pos) { | |
| 299 LogEvent(name, value, opt_boundary, opt_pos); | |
| 300 }; | |
|
beaudoin
2013/06/22 01:14:53
Please run this by Jered since you're changing the
| |
| 294 | 301 |
| 295 this.onmostvisitedchange = null; | 302 this.onmostvisitedchange = null; |
| 296 this.onthemechange = null; | 303 this.onthemechange = null; |
| 297 this.oninputstart = null; | 304 this.oninputstart = null; |
| 298 this.oninputcancel = null; | 305 this.oninputcancel = null; |
| 299 }; | 306 }; |
| 300 | 307 |
| 301 // Export legacy searchbox API. | 308 // Export legacy searchbox API. |
| 302 // TODO: Remove this when Instant Extended is fully launched. | 309 // TODO: Remove this when Instant Extended is fully launched. |
| 303 chrome.searchBox = this.searchBox; | 310 chrome.searchBox = this.searchBox; |
| 304 }; | 311 }; |
| 305 } | 312 } |
| OLD | NEW |