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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 } | 59 } |
60 | 60 |
61 /** | 61 /** |
62 * Sets the recommended apps. | 62 * Sets the recommended apps. |
63 * @param {Array.<Object>} apps An array of app info dictionary. | 63 * @param {Array.<Object>} apps An array of app info dictionary. |
64 */ | 64 */ |
65 function setRecommendedApps(apps) { | 65 function setRecommendedApps(apps) { |
66 $('start-page').setRecommendedApps(apps); | 66 $('start-page').setRecommendedApps(apps); |
67 } | 67 } |
68 | 68 |
| 69 /** |
| 70 * Invoked when the app-list bubble is shown. |
| 71 */ |
69 function onAppListShown() { | 72 function onAppListShown() { |
70 speechManager.start(); | 73 speechManager.start(); |
71 } | 74 } |
72 | 75 |
| 76 /** |
| 77 * Invoked when the app-list bubble is hidden. |
| 78 */ |
73 function onAppListHidden() { | 79 function onAppListHidden() { |
74 speechManager.stop(); | 80 speechManager.stop(); |
75 } | 81 } |
76 | 82 |
| 83 /** |
| 84 * Invoked when the user explicitly wants to toggle the speech recognition |
| 85 * state. |
| 86 */ |
| 87 function toggleSpeechRecognition() { |
| 88 speechManager.toggleSpeechRecognition(); |
| 89 } |
| 90 |
77 return { | 91 return { |
78 initialize: initialize, | 92 initialize: initialize, |
79 setRecommendedApps: setRecommendedApps, | 93 setRecommendedApps: setRecommendedApps, |
80 onAppListShown: onAppListShown, | 94 onAppListShown: onAppListShown, |
81 onAppListHidden: onAppListHidden | 95 onAppListHidden: onAppListHidden, |
| 96 toggleSpeechRecognition: toggleSpeechRecognition |
82 }; | 97 }; |
83 }); | 98 }); |
84 | 99 |
85 document.addEventListener('contextmenu', function(e) { e.preventDefault(); }); | 100 document.addEventListener('contextmenu', function(e) { e.preventDefault(); }); |
86 document.addEventListener('DOMContentLoaded', appList.startPage.initialize); | 101 document.addEventListener('DOMContentLoaded', appList.startPage.initialize); |
OLD | NEW |