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

Side by Side Diff: chrome/test/data/instant_extended.html

Issue 11889003: Fixing ESC in instant-extended. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 10 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
« no previous file with comments | « chrome/renderer/searchbox/searchbox_extension.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script> 3 <script>
4 4
5 var apiHandle; 5 var apiHandle;
6 var onnativesuggestioncalls = 0; 6 var onnativesuggestioncalls = 0;
7 var onsubmitcalls = 0; 7 var onsubmitcalls = 0;
8 var savedUserText = null; 8 var savedUserText = null;
9 var suggestionIndex = -1; 9 var suggestionIndex = -1;
10 var suggestions = ["result 1", "result 2", "result 3"]; 10 var suggestions = ["result 1", "result 2", "result 3"];
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 apiHandle.setValue(savedUserText); 54 apiHandle.setValue(savedUserText);
55 } else { 55 } else {
56 apiHandle.setValue(suggestions[suggestionIndex]); 56 apiHandle.setValue(suggestions[suggestionIndex]);
57 } 57 }
58 } 58 }
59 } 59 }
60 60
61 function handleKeyPress(event) { 61 function handleKeyPress(event) {
62 var VKEY_UP = 0x26; 62 var VKEY_UP = 0x26;
63 var VKEY_DOWN = 0x28; 63 var VKEY_DOWN = 0x28;
64 var VKEY_ESCAPE = 0x1B;
64 65
65 if (event.keyCode == VKEY_DOWN) { 66 if (event.keyCode == VKEY_DOWN) {
66 nextSuggestion(); 67 nextSuggestion();
67 } else if (event.keyCode == VKEY_UP) { 68 } else if (event.keyCode == VKEY_UP) {
68 previousSuggestion(); 69 previousSuggestion();
70 } else if (event.keyCode == VKEY_ESCAPE) {
71 suggestionIndex = -1;
69 } 72 }
70 } 73 }
71 74
72 function setUp() { 75 function setUp() {
73 apiHandle = getApiHandle(); 76 apiHandle = getApiHandle();
74 apiHandle.onnativesuggestions = handleNativeSuggestions; 77 apiHandle.onnativesuggestions = handleNativeSuggestions;
75 apiHandle.onsubmit = handleSubmit; 78 apiHandle.onsubmit = handleSubmit;
76 apiHandle.onchange = handleOnChange; 79 apiHandle.onchange = handleOnChange;
77 apiHandle.onkeypress = handleKeyPress; 80 apiHandle.onkeypress = handleKeyPress;
78 if (apiHandle.value) { 81 if (apiHandle.value) {
79 handleNativeSuggestions(); 82 handleNativeSuggestions();
80 handleOnChange(); 83 handleOnChange();
81 } 84 }
82 } 85 }
83 86
84 setUp(); 87 setUp();
85 88
86 </script> 89 </script>
87 </head> 90 </head>
88 <body> 91 <body>
89 <h1>Instant</h1> 92 <h1>Instant</h1>
90 </body> 93 </body>
91 </html> 94 </html>
OLDNEW
« no previous file with comments | « chrome/renderer/searchbox/searchbox_extension.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698