| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 * @fileoverview The ChromeVox panel and menus. | 6 * @fileoverview The ChromeVox panel and menus. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 goog.provide('Panel'); | 9 goog.provide('Panel'); |
| 10 | 10 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 document.addEventListener('keydown', Panel.onKeyDown, false); | 132 document.addEventListener('keydown', Panel.onKeyDown, false); |
| 133 document.addEventListener('mouseup', Panel.onMouseUp, false); | 133 document.addEventListener('mouseup', Panel.onMouseUp, false); |
| 134 window.addEventListener('blur', function(evt) { | 134 window.addEventListener('blur', function(evt) { |
| 135 if (evt.target != window || document.activeElement == document.body) | 135 if (evt.target != window || document.activeElement == document.body) |
| 136 return; | 136 return; |
| 137 | 137 |
| 138 Panel.closeMenusAndRestoreFocus(); | 138 Panel.closeMenusAndRestoreFocus(); |
| 139 }, false); | 139 }, false); |
| 140 | 140 |
| 141 Panel.searchInput_.addEventListener('blur', Panel.onSearchInputBlur, false); | 141 Panel.searchInput_.addEventListener('blur', Panel.onSearchInputBlur, false); |
| 142 |
| 143 // If OOBE is showing, automatically trigger the tutorial. |
| 144 chrome.automation.getDesktop(function(desktop) { |
| 145 var loadCompleteType = chrome.automation.EventType.loadComplete; |
| 146 var watchForOobe = function(evt) { |
| 147 if (evt.target.url == 'chrome://oobe/oobe') { |
| 148 desktop.removeEventListener(loadCompleteType, watchForOobe, false); |
| 149 Panel.onTutorial(); |
| 150 } |
| 151 }; |
| 152 desktop.addEventListener(loadCompleteType, watchForOobe, false); |
| 153 }); |
| 142 }; | 154 }; |
| 143 | 155 |
| 144 /** | 156 /** |
| 145 * Update the display based on prefs. | 157 * Update the display based on prefs. |
| 146 */ | 158 */ |
| 147 Panel.updateFromPrefs = function() { | 159 Panel.updateFromPrefs = function() { |
| 148 if (Panel.searching_) { | 160 if (Panel.searching_) { |
| 149 this.speechContainer_.hidden = true; | 161 this.speechContainer_.hidden = true; |
| 150 this.brailleContainer_.hidden = true; | 162 this.brailleContainer_.hidden = true; |
| 151 this.searchContainer_.hidden = false; | 163 this.searchContainer_.hidden = false; |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 }, false); | 854 }, false); |
| 843 | 855 |
| 844 window.addEventListener('hashchange', function() { | 856 window.addEventListener('hashchange', function() { |
| 845 if (location.hash == '#fullscreen' || location.hash == '#focus') { | 857 if (location.hash == '#fullscreen' || location.hash == '#focus') { |
| 846 this.originalStickyState_ = cvox.ChromeVox.isStickyPrefOn; | 858 this.originalStickyState_ = cvox.ChromeVox.isStickyPrefOn; |
| 847 cvox.ChromeVox.isStickyPrefOn = false; | 859 cvox.ChromeVox.isStickyPrefOn = false; |
| 848 } else { | 860 } else { |
| 849 cvox.ChromeVox.isStickyPrefOn = this.originalStickyState_; | 861 cvox.ChromeVox.isStickyPrefOn = this.originalStickyState_; |
| 850 } | 862 } |
| 851 }, false); | 863 }, false); |
| OLD | NEW |