OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 App launcher start page implementation. | 6 * @fileoverview App launcher start page implementation. |
7 */ | 7 */ |
8 | 8 |
9 <include src="recommended_apps.js"/> | 9 <include src="recommended_apps.js"/> |
10 <include src="speech_manager.js"/> | 10 <include src="speech_manager.js"/> |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 /** | 69 /** |
70 * Invoked when the hotword plugin availability is changed. | 70 * Invoked when the hotword plugin availability is changed. |
71 * | 71 * |
72 * @param {boolean} enabled Whether the plugin is enabled or not. | 72 * @param {boolean} enabled Whether the plugin is enabled or not. |
73 */ | 73 */ |
74 function setHotwordEnabled(enabled) { | 74 function setHotwordEnabled(enabled) { |
75 speechManager.setHotwordEnabled(enabled); | 75 speechManager.setHotwordEnabled(enabled); |
76 } | 76 } |
77 | 77 |
78 /** | 78 /** |
| 79 * Sets the architecture of NaCl module to be loaded for hotword. |
| 80 * @param {string} arch The architecture. |
| 81 */ |
| 82 function setNaclArch(arch) { |
| 83 speechManager.setNaclArch(arch); |
| 84 } |
| 85 |
| 86 /** |
79 * Invoked when the app-list bubble is shown. | 87 * Invoked when the app-list bubble is shown. |
80 * | 88 * |
81 * @param {boolean} hotwordEnabled Whether the hotword is enabled or not. | 89 * @param {boolean} hotwordEnabled Whether the hotword is enabled or not. |
82 */ | 90 */ |
83 function onAppListShown(hotwordEnabled) { | 91 function onAppListShown(hotwordEnabled) { |
84 speechManager.onShown(hotwordEnabled); | 92 speechManager.onShown(hotwordEnabled); |
85 } | 93 } |
86 | 94 |
87 /** | 95 /** |
88 * Invoked when the app-list bubble is hidden. | 96 * Invoked when the app-list bubble is hidden. |
89 */ | 97 */ |
90 function onAppListHidden() { | 98 function onAppListHidden() { |
91 speechManager.onHidden(); | 99 speechManager.onHidden(); |
92 } | 100 } |
93 | 101 |
94 /** | 102 /** |
95 * Invoked when the user explicitly wants to toggle the speech recognition | 103 * Invoked when the user explicitly wants to toggle the speech recognition |
96 * state. | 104 * state. |
97 */ | 105 */ |
98 function toggleSpeechRecognition() { | 106 function toggleSpeechRecognition() { |
99 speechManager.toggleSpeechRecognition(); | 107 speechManager.toggleSpeechRecognition(); |
100 } | 108 } |
101 | 109 |
102 return { | 110 return { |
103 initialize: initialize, | 111 initialize: initialize, |
104 setRecommendedApps: setRecommendedApps, | 112 setRecommendedApps: setRecommendedApps, |
105 setHotwordEnabled: setHotwordEnabled, | 113 setHotwordEnabled: setHotwordEnabled, |
| 114 setNaclArch: setNaclArch, |
106 onAppListShown: onAppListShown, | 115 onAppListShown: onAppListShown, |
107 onAppListHidden: onAppListHidden, | 116 onAppListHidden: onAppListHidden, |
108 toggleSpeechRecognition: toggleSpeechRecognition | 117 toggleSpeechRecognition: toggleSpeechRecognition |
109 }; | 118 }; |
110 }); | 119 }); |
111 | 120 |
112 document.addEventListener('contextmenu', function(e) { e.preventDefault(); }); | 121 document.addEventListener('contextmenu', function(e) { e.preventDefault(); }); |
113 document.addEventListener('DOMContentLoaded', appList.startPage.initialize); | 122 document.addEventListener('DOMContentLoaded', appList.startPage.initialize); |
OLD | NEW |