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

Side by Side Diff: chrome/test/data/extensions/api_test/omnibox/test.html

Issue 5064001: More changes to extension omnibox API for styles. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: offset Created 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/docs/experimental.omnibox.html ('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 <script> 1 <script>
2 if (!chrome.omnibox) { 2 if (!chrome.omnibox) {
3 chrome.omnibox = chrome.experimental.omnibox; 3 chrome.omnibox = chrome.experimental.omnibox;
4 } 4 }
5 5
6 chrome.omnibox.onInputChanged.addListener( 6 chrome.omnibox.onInputChanged.addListener(
7 function(text, suggest) { 7 function(text, suggest) {
8 chrome.test.log("onInputChanged: " + text); 8 chrome.test.log("onInputChanged: " + text);
9 if (text != "suggestio") 9 if (text != "suggestio")
10 return; 10 return;
11 11
12 var desc = 'Description with style: <match> [dim], none'; 12 var desc = 'Description with style: <match>, [dim], (url till end)';
13 suggest([ 13 suggest([
14 { 14 {
15 content: text + "n1", 15 content: text + "n1",
16 description: desc, 16 description: desc,
17 descriptionStyles: [ 17 descriptionStyles: [
18 chrome.omnibox.styleMatch(desc.indexOf('<'), 6), 18 chrome.omnibox.styleMatch(desc.indexOf('<'), 6),
19 chrome.omnibox.styleDim(desc.indexOf('['), 4), 19 chrome.omnibox.styleDim(desc.indexOf('['), 4),
20 chrome.omnibox.styleUrl(desc.indexOf('(')),
20 ] 21 ]
21 }, 22 },
22 {content: text + "n2", description: "description2"}, 23 {content: text + "n2", description: "description2"},
23 {content: text + "n3", description: "description3"}, 24 {content: text + "n3", description: "description3"},
24 ]); 25 ]);
25 }); 26 });
26 27
27 chrome.omnibox.onInputEntered.addListener( 28 chrome.omnibox.onInputEntered.addListener(
28 function(text) { 29 function(text) {
29 chrome.test.assertEq("command", text); 30 chrome.test.assertEq("command", text);
30 chrome.test.notifyPass(); 31 chrome.test.notifyPass();
31 }); 32 });
32 33
33 // Now we wait for the input events to fire. 34 // Now we wait for the input events to fire.
34 chrome.test.notifyPass(); 35 chrome.test.notifyPass();
35 </script> 36 </script>
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/experimental.omnibox.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698