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

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: hopefully fix tests 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 var newRelevance = result.rankingData.relevance; 92 var newRelevance = result.rankingData.relevance;
93 if (newRelevance > oldRelevance) { 93 if (newRelevance > oldRelevance) {
94 urlToResultMap[url] = result; 94 urlToResultMap[url] = result;
95 } 95 }
96 } else { 96 } else {
97 urlToResultMap[url] = result; 97 urlToResultMap[url] = result;
98 } 98 }
99 } 99 }
100 var dedupedResults = []; 100 var dedupedResults = [];
101 for (url in urlToResultMap) { 101 for (url in urlToResultMap) {
102 dedupedResults.push(urlToResultMap[url]); 102 $Array.push(dedupedResults, urlToResultMap[url]);
103 } 103 }
104 return dedupedResults; 104 return dedupedResults;
105 } 105 }
106 106
107 var lastPrefixQueriedForDuplicates = ''; 107 var lastPrefixQueriedForDuplicates = '';
108 var numDedupeAttempts = 0; 108 var numDedupeAttempts = 0;
109 109
110 function DedupeClientSuggestions(clientSuggestions) { 110 function DedupeClientSuggestions(clientSuggestions) {
111 var userInput = GetQuery(); 111 var userInput = GetQuery();
112 if (userInput == lastPrefixQueriedForDuplicates) { 112 if (userInput == lastPrefixQueriedForDuplicates) {
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 this.onthemechange = null; 292 this.onthemechange = null;
293 this.oninputstart = null; 293 this.oninputstart = null;
294 this.oninputcancel = null; 294 this.oninputcancel = null;
295 }; 295 };
296 296
297 // Export legacy searchbox API. 297 // Export legacy searchbox API.
298 // TODO: Remove this when Instant Extended is fully launched. 298 // TODO: Remove this when Instant Extended is fully launched.
299 chrome.searchBox = this.searchBox; 299 chrome.searchBox = this.searchBox;
300 }; 300 };
301 } 301 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698