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

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

Issue 11369137: Implement {Start,Stop}CapturingKeyStrokes for Instant. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix which active tab we use. Created 8 years, 1 month 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 if (!chrome.searchBox) { 8 if (!chrome.searchBox) {
9 chrome.searchBox = new function() { 9 chrome.searchBox = new function() {
10 // ========================================================================= 10 // =========================================================================
(...skipping 20 matching lines...) Expand all
31 native function GetAutocompleteResults(); 31 native function GetAutocompleteResults();
32 native function GetIsFocused(); 32 native function GetIsFocused();
33 native function GetContext(); 33 native function GetContext();
34 native function NavigateContentWindow(); 34 native function NavigateContentWindow();
35 native function SetSuggestions(); 35 native function SetSuggestions();
36 native function SetQuerySuggestion(); 36 native function SetQuerySuggestion();
37 native function SetQuerySuggestionFromAutocompleteResult(); 37 native function SetQuerySuggestionFromAutocompleteResult();
38 native function SetQuery(); 38 native function SetQuery();
39 native function SetQueryFromAutocompleteResult(); 39 native function SetQueryFromAutocompleteResult();
40 native function Show(); 40 native function Show();
41 native function WebSearchBoxGotFocus();
42 native function WebSearchBoxLostFocus();
41 43
42 // Returns the |restrictedText| wrapped in a ShadowDOM. 44 // Returns the |restrictedText| wrapped in a ShadowDOM.
43 function SafeWrap(restrictedText) { 45 function SafeWrap(restrictedText) {
44 var node = document.createElement('div'); 46 var node = document.createElement('div');
45 var nodeShadow = new WebKitShadowRoot(node); 47 var nodeShadow = new WebKitShadowRoot(node);
46 nodeShadow.applyAuthorStyles = true; 48 nodeShadow.applyAuthorStyles = true;
47 nodeShadow.innerHTML = 49 nodeShadow.innerHTML =
48 '<div style="width:700px!important;' + 50 '<div style="width:700px!important;' +
49 ' height:22px!important;' + 51 ' height:22px!important;' +
50 ' font-family:\'Chrome Droid Sans\',\'Arial\'!important;' + 52 ' font-family:\'Chrome Droid Sans\',\'Arial\'!important;' +
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 }; 196 };
195 this.show = function(reason, height) { 197 this.show = function(reason, height) {
196 Show(reason, height); 198 Show(reason, height);
197 }; 199 };
198 this.markDuplicateSuggestions = function(clientSuggestions) { 200 this.markDuplicateSuggestions = function(clientSuggestions) {
199 return DedupeClientSuggestions(clientSuggestions); 201 return DedupeClientSuggestions(clientSuggestions);
200 }; 202 };
201 this.navigateContentWindow = function(destination) { 203 this.navigateContentWindow = function(destination) {
202 return NavigateContentWindow(destination); 204 return NavigateContentWindow(destination);
203 }; 205 };
206 this.webSearchBoxGotFocus = function() {
207 WebSearchBoxGotFocus();
208 };
209 this.webSearchBoxLostFocus = function() {
210 WebSearchBoxLostFocus();
211 };
204 this.onchange = null; 212 this.onchange = null;
205 this.onsubmit = null; 213 this.onsubmit = null;
206 this.oncancel = null; 214 this.oncancel = null;
207 this.onresize = null; 215 this.onresize = null;
208 this.onautocompleteresults = null; 216 this.onautocompleteresults = null;
209 this.onkeypress = null; 217 this.onkeypress = null;
210 this.onfocus = null; 218 this.onfocus = null;
211 this.onblur = null; 219 this.onblur = null;
212 this.oncontextchange = null; 220 this.oncontextchange = null;
213 }; 221 };
214 } 222 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698