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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 /** | 69 /** |
70 * Invoked when the app-list bubble is shown. | 70 * Invoked when the app-list bubble is shown. |
71 */ | 71 */ |
72 function onAppListShown() { | 72 function onAppListShown() { |
73 speechManager.start(); | 73 speechManager.onShown(); |
74 } | 74 } |
75 | 75 |
76 /** | 76 /** |
77 * Invoked when the app-list bubble is hidden. | 77 * Invoked when the app-list bubble is hidden. |
78 */ | 78 */ |
79 function onAppListHidden() { | 79 function onAppListHidden() { |
80 speechManager.stop(); | 80 speechManager.onHidden(); |
81 } | 81 } |
82 | 82 |
83 /** | 83 /** |
84 * Invoked when the user explicitly wants to toggle the speech recognition | 84 * Invoked when the user explicitly wants to toggle the speech recognition |
85 * state. | 85 * state. |
86 */ | 86 */ |
87 function toggleSpeechRecognition() { | 87 function toggleSpeechRecognition() { |
88 speechManager.toggleSpeechRecognition(); | 88 speechManager.toggleSpeechRecognition(); |
89 } | 89 } |
90 | 90 |
91 return { | 91 return { |
92 initialize: initialize, | 92 initialize: initialize, |
93 setRecommendedApps: setRecommendedApps, | 93 setRecommendedApps: setRecommendedApps, |
94 onAppListShown: onAppListShown, | 94 onAppListShown: onAppListShown, |
95 onAppListHidden: onAppListHidden, | 95 onAppListHidden: onAppListHidden, |
96 toggleSpeechRecognition: toggleSpeechRecognition | 96 toggleSpeechRecognition: toggleSpeechRecognition |
97 }; | 97 }; |
98 }); | 98 }); |
99 | 99 |
100 document.addEventListener('contextmenu', function(e) { e.preventDefault(); }); | 100 document.addEventListener('contextmenu', function(e) { e.preventDefault(); }); |
101 document.addEventListener('DOMContentLoaded', appList.startPage.initialize); | 101 document.addEventListener('DOMContentLoaded', appList.startPage.initialize); |
OLD | NEW |