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

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

Issue 11369137: Implement {Start,Stop}CapturingKeyStrokes for Instant. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase. Created 8 years 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 21 matching lines...) Expand all
32 native function GetContext(); 32 native function GetContext();
33 native function GetThemeBackgroundInfo(); 33 native function GetThemeBackgroundInfo();
34 native function GetThemeAreaHeight(); 34 native function GetThemeAreaHeight();
35 native function NavigateContentWindow(); 35 native function NavigateContentWindow();
36 native function SetSuggestions(); 36 native function SetSuggestions();
37 native function SetQuerySuggestion(); 37 native function SetQuerySuggestion();
38 native function SetQuerySuggestionFromAutocompleteResult(); 38 native function SetQuerySuggestionFromAutocompleteResult();
39 native function SetQuery(); 39 native function SetQuery();
40 native function SetQueryFromAutocompleteResult(); 40 native function SetQueryFromAutocompleteResult();
41 native function Show(); 41 native function Show();
42 native function StartCapturingKeyStrokes();
43 native function StopCapturingKeyStrokes();
42 44
43 // Returns the |restrictedText| wrapped in a ShadowDOM. 45 // Returns the |restrictedText| wrapped in a ShadowDOM.
44 function SafeWrap(restrictedText) { 46 function SafeWrap(restrictedText) {
45 var node = document.createElement('div'); 47 var node = document.createElement('div');
46 var nodeShadow = new WebKitShadowRoot(node); 48 var nodeShadow = new WebKitShadowRoot(node);
47 nodeShadow.applyAuthorStyles = true; 49 nodeShadow.applyAuthorStyles = true;
48 nodeShadow.innerHTML = 50 nodeShadow.innerHTML =
49 '<div style="width:700px!important;' + 51 '<div style="width:700px!important;' +
50 ' height:22px!important;' + 52 ' height:22px!important;' +
51 ' font-family:\'Chrome Droid Sans\',\'Arial\'!important;' + 53 ' font-family:\'Chrome Droid Sans\',\'Arial\'!important;' +
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 }; 198 };
197 this.show = function(reason, height) { 199 this.show = function(reason, height) {
198 Show(reason, height); 200 Show(reason, height);
199 }; 201 };
200 this.markDuplicateSuggestions = function(clientSuggestions) { 202 this.markDuplicateSuggestions = function(clientSuggestions) {
201 return DedupeClientSuggestions(clientSuggestions); 203 return DedupeClientSuggestions(clientSuggestions);
202 }; 204 };
203 this.navigateContentWindow = function(destination) { 205 this.navigateContentWindow = function(destination) {
204 return NavigateContentWindow(destination); 206 return NavigateContentWindow(destination);
205 }; 207 };
208 this.startCapturingKeyStrokes = function() {
209 StartCapturingKeyStrokes();
210 };
211 this.stopCapturingKeyStrokes = function() {
212 StopCapturingKeyStrokes();
213 };
206 this.onchange = null; 214 this.onchange = null;
207 this.onsubmit = null; 215 this.onsubmit = null;
208 this.oncancel = null; 216 this.oncancel = null;
209 this.onresize = null; 217 this.onresize = null;
210 this.onautocompleteresults = null; 218 this.onautocompleteresults = null;
211 this.onkeypress = null; 219 this.onkeypress = null;
212 this.oncontextchange = null; 220 this.oncontextchange = null;
213 }; 221 };
214 } 222 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698