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

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

Issue 16413002: Moved theme related state from BrowserInstantController to InstantService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 6 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.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 newTabPageHandle; 6 var newTabPageHandle;
7 var savedUserText = null; 7 var savedUserText = null;
8 var suggestionIndex = -1; 8 var suggestionIndex = -1;
9 var suggestions = ["result 1", "result 2", "http://www.google.com"]; 9 var suggestions = ["result 1", "result 2", "http://www.google.com"];
10 var suggestion; 10 var suggestion;
11 var suggestionType = 0; // INSTANT_SUGGESTION_SEARCH 11 var suggestionType = 0; // INSTANT_SUGGESTION_SEARCH
12 var behavior = 2; // INSTANT_COMPLETE_NEVER 12 var behavior = 2; // INSTANT_COMPLETE_NEVER
13 var onMostVisitedChangedCalls = 0; 13 var onMostVisitedChangedCalls = 0;
14 var mostVisitedItemsCount = 0; 14 var mostVisitedItemsCount = 0;
15 var firstMostVisitedItemId = 0; 15 var firstMostVisitedItemId = 0;
16 var onNativeSuggestionsCalls = 0; 16 var onNativeSuggestionsCalls = 0;
17 var onChangeCalls = 0; 17 var onChangeCalls = 0;
18 var submitCount = 0; 18 var submitCount = 0;
19 var onEscKeyPressedCalls = 0; 19 var onEscKeyPressedCalls = 0;
20 var onFocusChangedCalls = 0; 20 var onFocusChangedCalls = 0;
21 var onToggleVoiceSearchCalls = 0; 21 var onToggleVoiceSearchCalls = 0;
22 var isFocused = false; 22 var isFocused = false;
23 var onvisibilitycalls = 0; 23 var onvisibilitycalls = 0;
24 var onThemeChangedCalls = 0;
24 25
25 function getApiHandle() { 26 function getApiHandle() {
26 if (window.navigator && window.navigator.searchBox) 27 if (window.navigator && window.navigator.searchBox)
27 return window.navigator.searchBox; 28 return window.navigator.searchBox;
28 if (window.chrome && window.chrome.searchBox) 29 if (window.chrome && window.chrome.searchBox)
29 return window.chrome.searchBox; 30 return window.chrome.searchBox;
30 return null; 31 return null;
31 } 32 }
32 33
33 function getNewTabPageHandle() { 34 function getNewTabPageHandle() {
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 111
111 function handleFocusChange() { 112 function handleFocusChange() {
112 onFocusChangedCalls++; 113 onFocusChangedCalls++;
113 isFocused = apiHandle.isFocused; 114 isFocused = apiHandle.isFocused;
114 } 115 }
115 116
116 function handleToggleVoiceSearch() { 117 function handleToggleVoiceSearch() {
117 onToggleVoiceSearchCalls++; 118 onToggleVoiceSearchCalls++;
118 } 119 }
119 120
121 function handleThemeChange() {
122 onThemeChangedCalls++;
123 }
124
120 function setUp() { 125 function setUp() {
121 apiHandle = getApiHandle(); 126 apiHandle = getApiHandle();
122 if (!apiHandle) 127 if (!apiHandle)
123 return; 128 return;
124 129
125 newTabPageHandle = getNewTabPageHandle(); 130 newTabPageHandle = getNewTabPageHandle();
126 apiHandle.onnativesuggestions = handleNativeSuggestions; 131 apiHandle.onnativesuggestions = handleNativeSuggestions;
127 apiHandle.onsubmit = handleSubmit; 132 apiHandle.onsubmit = handleSubmit;
128 apiHandle.onchange = handleOnChange; 133 apiHandle.onchange = handleOnChange;
129 apiHandle.onkeypress = handleKeyPress; 134 apiHandle.onkeypress = handleKeyPress;
130 apiHandle.onfocuschange = handleFocusChange; 135 apiHandle.onfocuschange = handleFocusChange;
131 apiHandle.ontogglevoicesearch = handleToggleVoiceSearch; 136 apiHandle.ontogglevoicesearch = handleToggleVoiceSearch;
132 newTabPageHandle.onmostvisitedchange = handleMostVisitedChange; 137 newTabPageHandle.onmostvisitedchange = handleMostVisitedChange;
138 newTabPageHandle.onthemechange = handleThemeChange;
133 if (apiHandle.value) { 139 if (apiHandle.value) {
134 handleNativeSuggestions(); 140 handleNativeSuggestions();
135 handleOnChange(); 141 handleOnChange();
136 } 142 }
137 if (newTabPageHandle.mostVisited && newTabPageHandle.mostVisited.length) { 143 if (newTabPageHandle.mostVisited && newTabPageHandle.mostVisited.length) {
138 handleMostVisitedChange(); 144 handleMostVisitedChange();
139 } 145 }
140 handleFocusChange(); 146 handleFocusChange();
141 } 147 }
142 148
143 setUp(); 149 setUp();
144 150
145 </script> 151 </script>
146 </head> 152 </head>
147 <body> 153 <body>
148 <h1>Instant</h1> 154 <h1>Instant</h1>
149 </body> 155 </body>
150 </html> 156 </html>
OLDNEW
« no previous file with comments | « chrome/renderer/searchbox/searchbox.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698