OLD | NEW |
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 <include src="../uber/uber_utils.js"> | 5 <include src="../uber/uber_utils.js"> |
6 | 6 |
7 /////////////////////////////////////////////////////////////////////////////// | 7 /////////////////////////////////////////////////////////////////////////////// |
8 // Globals: | 8 // Globals: |
9 /** @const */ var RESULTS_PER_PAGE = 150; | 9 /** @const */ var RESULTS_PER_PAGE = 150; |
10 | 10 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 } | 191 } |
192 | 192 |
193 // Let the entryBox be styled appropriately when it contains keyboard focus. | 193 // Let the entryBox be styled appropriately when it contains keyboard focus. |
194 entryBox.addEventListener('focus', function() { | 194 entryBox.addEventListener('focus', function() { |
195 this.classList.add('contains-focus'); | 195 this.classList.add('contains-focus'); |
196 }, true); | 196 }, true); |
197 entryBox.addEventListener('blur', function() { | 197 entryBox.addEventListener('blur', function() { |
198 this.classList.remove('contains-focus'); | 198 this.classList.remove('contains-focus'); |
199 }, true); | 199 }, true); |
200 | 200 |
201 node.appendChild(entryBox); | 201 var entryBoxContainer = |
202 if (this.model_.isManagedProfile && this.model_.getGroupByDomain()) { | 202 createElementWithClassName('div', 'entry-box-container'); |
203 node.appendChild( | 203 node.appendChild(entryBoxContainer); |
| 204 entryBoxContainer.appendChild(entryBox); |
| 205 if (!isSearchResult && this.model_.isManagedProfile && |
| 206 this.model_.getGroupByDomain()) { |
| 207 entryBoxContainer.appendChild( |
204 getManagedStatusDOM(this.urlManualBehavior, this.urlInContentPack)); | 208 getManagedStatusDOM(this.urlManualBehavior, this.urlInContentPack)); |
205 } | 209 } |
206 | 210 |
207 if (isSearchResult) { | 211 if (isSearchResult) { |
208 time.appendChild(document.createTextNode(this.dateShort)); | 212 time.appendChild(document.createTextNode(this.dateShort)); |
209 var snippet = createElementWithClassName('div', 'snippet'); | 213 var snippet = createElementWithClassName('div', 'snippet'); |
210 this.addHighlightedText_(snippet, | 214 this.addHighlightedText_(snippet, |
211 this.snippet_, | 215 this.snippet_, |
212 this.model_.getSearchText()); | 216 this.model_.getSearchText()); |
213 node.appendChild(snippet); | 217 node.appendChild(snippet); |
(...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1844 } | 1848 } |
1845 } | 1849 } |
1846 | 1850 |
1847 // Add handlers to HTML elements. | 1851 // Add handlers to HTML elements. |
1848 document.addEventListener('DOMContentLoaded', load); | 1852 document.addEventListener('DOMContentLoaded', load); |
1849 | 1853 |
1850 // This event lets us enable and disable menu items before the menu is shown. | 1854 // This event lets us enable and disable menu items before the menu is shown. |
1851 document.addEventListener('canExecute', function(e) { | 1855 document.addEventListener('canExecute', function(e) { |
1852 e.canExecute = true; | 1856 e.canExecute = true; |
1853 }); | 1857 }); |
OLD | NEW |