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

Side by Side Diff: chrome/test/data/instant/search.html

Issue 6310003: Support specified JSON as argument to setSuggestions(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome
Patch Set: Address comments Created 9 years, 11 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_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 <body> 2 <body>
3 <h1>Instant</h1> 3 <h1>Instant</h1>
4 <div id=log></div> 4 <div id=log></div>
5 <script> 5 <script>
6 window.chrome.sv = true; 6 window.chrome.sv = true;
7 7
8 window.onsubmitcalls = 0; 8 window.onsubmitcalls = 0;
9 window.onchangecalls = 0; 9 window.onchangecalls = 0;
10 window.oncancelcalls = 0; 10 window.oncancelcalls = 0;
11 window.onresizecalls = 0; 11 window.onresizecalls = 0;
12 12
13 var searchBox = window.chrome.searchBox || {}; 13 var searchBox = window.chrome.searchBox || {};
14 14
15 window.beforeLoadSearchBox = {}; 15 window.beforeLoadSearchBox = {};
16 for (var prop in searchBox) window.beforeLoadSearchBox[prop] = searchBox[prop]; 16 for (var prop in searchBox) window.beforeLoadSearchBox[prop] = searchBox[prop];
17 17
18 window.setSuggestionsArgument = {
19 suggestions: [
20 { value: "abcdef" }
21 ]
22 };
23
18 window.chrome.searchBox.onsubmit = function() { 24 window.chrome.searchBox.onsubmit = function() {
19 searchBox.setSuggestions(["abcdef"]); 25 searchBox.setSuggestions(setSuggestionsArgument);
20 window.onsubmitcalls++; 26 window.onsubmitcalls++;
21 }; 27 };
22 28
23 window.chrome.searchBox.onchange = function() { 29 window.chrome.searchBox.onchange = function() {
24 searchBox.setSuggestions(["abcdef"]); 30 searchBox.setSuggestions(setSuggestionsArgument);
25 window.onchangecalls++; 31 window.onchangecalls++;
26 }; 32 };
27 33
28 window.chrome.searchBox.oncancel = function() { 34 window.chrome.searchBox.oncancel = function() {
29 searchBox.setSuggestions(["abcdef"]); 35 searchBox.setSuggestions(setSuggestionsArgument);
30 window.oncancelcalls++; 36 window.oncancelcalls++;
31 }; 37 };
32 38
33 window.chrome.searchBox.onresize = function() { 39 window.chrome.searchBox.onresize = function() {
34 window.onresizecalls++; 40 window.onresizecalls++;
35 }; 41 };
36 </script> 42 </script>
37 </body> 43 </body>
38 </html> 44 </html>
OLDNEW
« no previous file with comments | « chrome/renderer/searchbox_extension.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698