Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(351)

Side by Side Diff: chrome/renderer/resources/extensions/searchbox_api.js

Issue 17451011: Make the externally connectable browser test clobber all of the builtins, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 var newRelevance = result.rankingData.relevance; 93 var newRelevance = result.rankingData.relevance;
94 if (newRelevance > oldRelevance) { 94 if (newRelevance > oldRelevance) {
95 urlToResultMap[url] = result; 95 urlToResultMap[url] = result;
96 } 96 }
97 } else { 97 } else {
98 urlToResultMap[url] = result; 98 urlToResultMap[url] = result;
99 } 99 }
100 } 100 }
101 var dedupedResults = []; 101 var dedupedResults = [];
102 for (url in urlToResultMap) { 102 for (url in urlToResultMap) {
103 dedupedResults.push(urlToResultMap[url]); 103 $Array.push(dedupedResults, urlToResultMap[url]);
104 } 104 }
105 return dedupedResults; 105 return dedupedResults;
106 } 106 }
107 107
108 var lastPrefixQueriedForDuplicates = ''; 108 var lastPrefixQueriedForDuplicates = '';
109 var numDedupeAttempts = 0; 109 var numDedupeAttempts = 0;
110 110
111 function DedupeClientSuggestions(clientSuggestions) { 111 function DedupeClientSuggestions(clientSuggestions) {
112 var userInput = GetQuery(); 112 var userInput = GetQuery();
113 if (userInput == lastPrefixQueriedForDuplicates) { 113 if (userInput == lastPrefixQueriedForDuplicates) {
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 this.onthemechange = null; 296 this.onthemechange = null;
297 this.oninputstart = null; 297 this.oninputstart = null;
298 this.oninputcancel = null; 298 this.oninputcancel = null;
299 }; 299 };
300 300
301 // Export legacy searchbox API. 301 // Export legacy searchbox API.
302 // TODO: Remove this when Instant Extended is fully launched. 302 // TODO: Remove this when Instant Extended is fully launched.
303 chrome.searchBox = this.searchBox; 303 chrome.searchBox = this.searchBox;
304 }; 304 };
305 } 305 }
OLDNEW
« no previous file with comments | « chrome/renderer/resources/extensions/schema_utils.js ('k') | chrome/renderer/resources/extensions/send_request.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698