| 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 }); | |
| 154 }; | 142 }; |
| 155 | 143 |
| 156 /** | 144 /** |
| 157 * Update the display based on prefs. | 145 * Update the display based on prefs. |
| 158 */ | 146 */ |
| 159 Panel.updateFromPrefs = function() { | 147 Panel.updateFromPrefs = function() { |
| 160 if (Panel.searching_) { | 148 if (Panel.searching_) { |
| 161 this.speechContainer_.hidden = true; | 149 this.speechContainer_.hidden = true; |
| 162 this.brailleContainer_.hidden = true; | 150 this.brailleContainer_.hidden = true; |
| 163 this.searchContainer_.hidden = false; | 151 this.searchContainer_.hidden = false; |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 }, false); | 842 }, false); |
| 855 | 843 |
| 856 window.addEventListener('hashchange', function() { | 844 window.addEventListener('hashchange', function() { |
| 857 if (location.hash == '#fullscreen' || location.hash == '#focus') { | 845 if (location.hash == '#fullscreen' || location.hash == '#focus') { |
| 858 this.originalStickyState_ = cvox.ChromeVox.isStickyPrefOn; | 846 this.originalStickyState_ = cvox.ChromeVox.isStickyPrefOn; |
| 859 cvox.ChromeVox.isStickyPrefOn = false; | 847 cvox.ChromeVox.isStickyPrefOn = false; |
| 860 } else { | 848 } else { |
| 861 cvox.ChromeVox.isStickyPrefOn = this.originalStickyState_; | 849 cvox.ChromeVox.isStickyPrefOn = this.originalStickyState_; |
| 862 } | 850 } |
| 863 }, false); | 851 }, false); |
| OLD | NEW |