| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 | 5 |
| 6 goog.provide('cvox.SearchLoader'); | 6 goog.provide('cvox.SearchLoader'); |
| 7 goog.require('cvox.SearchContextMenu'); | 7 goog.require('cvox.SearchContextMenu'); |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * @fileoverview Inject the script into the page. | 10 * @fileoverview Inject the script into the page. |
| 11 */ | 11 */ |
| 12 | 12 |
| 13 /** | 13 /** |
| 14 * @constructor | 14 * @constructor |
| 15 */ | 15 */ |
| 16 cvox.SearchLoader = function() { | 16 cvox.SearchLoader = function() {}; |
| 17 }; | |
| 18 | 17 |
| 19 /** | 18 /** |
| 20 * Called when document ready state changes. | 19 * Called when document ready state changes. |
| 21 */ | 20 */ |
| 22 cvox.SearchLoader.onReadyStateChange = function() { | 21 cvox.SearchLoader.onReadyStateChange = function() { |
| 23 /* Make sure document is complete. Loading base.js when the document is | 22 /* Make sure document is complete. Loading base.js when the document is |
| 24 * loading will destroy the DOM. */ | 23 * loading will destroy the DOM. */ |
| 25 if (document.readyState !== 'complete') { | 24 if (document.readyState !== 'complete') { |
| 26 return; | 25 return; |
| 27 } | 26 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 39 /** | 38 /** |
| 40 * Inject Search into the page. | 39 * Inject Search into the page. |
| 41 */ | 40 */ |
| 42 cvox.SearchLoader.init = function() { | 41 cvox.SearchLoader.init = function() { |
| 43 if (document.readyState !== 'complete') { | 42 if (document.readyState !== 'complete') { |
| 44 document.onreadystatechange = cvox.SearchLoader.onReadyStateChange; | 43 document.onreadystatechange = cvox.SearchLoader.onReadyStateChange; |
| 45 } else { | 44 } else { |
| 46 cvox.SearchLoader.onReadyStateChange(); | 45 cvox.SearchLoader.onReadyStateChange(); |
| 47 } | 46 } |
| 48 }; | 47 }; |
| OLD | NEW |