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 * Invoked when the hotword recognition should start. | |
80 */ | |
81 function startHotwordRecognition() { | |
82 speechManager.startHotwordRecognition(); | |
83 } | |
84 | |
85 /** | |
86 * Invoked when the hotword recognition should stop. | |
87 */ | |
88 function stopHotwordRecognition() { | |
89 speechManager.stopHotwordRecognition(); | |
90 } | |
91 | |
92 /** | |
93 * Invoked when the app-list bubble is shown. | 79 * Invoked when the app-list bubble is shown. |
94 */ | 80 */ |
95 function onAppListShown() { | 81 function onAppListShown() { |
96 speechManager.onShown(); | 82 speechManager.onShown(); |
97 } | 83 } |
98 | 84 |
99 /** | 85 /** |
100 * Invoked when the app-list bubble is hidden. | 86 * Invoked when the app-list bubble is hidden. |
101 */ | 87 */ |
102 function onAppListHidden() { | 88 function onAppListHidden() { |
103 speechManager.onHidden(); | 89 speechManager.onHidden(); |
104 } | 90 } |
105 | 91 |
106 /** | 92 /** |
107 * Invoked when the user explicitly wants to toggle the speech recognition | 93 * Invoked when the user explicitly wants to toggle the speech recognition |
108 * state. | 94 * state. |
109 */ | 95 */ |
110 function toggleSpeechRecognition() { | 96 function toggleSpeechRecognition() { |
111 speechManager.toggleSpeechRecognition(); | 97 speechManager.toggleSpeechRecognition(); |
112 } | 98 } |
113 | 99 |
114 return { | 100 return { |
115 initialize: initialize, | 101 initialize: initialize, |
116 setRecommendedApps: setRecommendedApps, | 102 setRecommendedApps: setRecommendedApps, |
117 setHotwordEnabled: setHotwordEnabled, | 103 setHotwordEnabled: setHotwordEnabled, |
118 startHotwordRecognition: startHotwordRecognition, | |
119 stopHotwordRecognition: stopHotwordRecognition, | |
120 onAppListShown: onAppListShown, | 104 onAppListShown: onAppListShown, |
121 onAppListHidden: onAppListHidden, | 105 onAppListHidden: onAppListHidden, |
122 toggleSpeechRecognition: toggleSpeechRecognition | 106 toggleSpeechRecognition: toggleSpeechRecognition |
123 }; | 107 }; |
124 }); | 108 }); |
125 | 109 |
126 document.addEventListener('contextmenu', function(e) { e.preventDefault(); }); | 110 document.addEventListener('contextmenu', function(e) { e.preventDefault(); }); |
127 document.addEventListener('DOMContentLoaded', appList.startPage.initialize); | 111 document.addEventListener('DOMContentLoaded', appList.startPage.initialize); |
OLD | NEW |