| 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 cr.define('appList.startPage', function() { | 9 cr.define('appList.startPage', function() { |
| 10 'use strict'; | 10 'use strict'; |
| 11 | 11 |
| 12 // The element containing the current Google Doodle. | 12 // The element containing the current Google Doodle. |
| 13 var doodle = null; | 13 var doodle = null; |
| 14 | 14 |
| 15 // TODO(calamity): This is used for manual inspection of the doodle data. | 15 // TODO(calamity): This is used for manual inspection of the doodle data. |
| 16 // Remove this once http://crbug.com/462082 is diagnosed. | 16 // Remove this once http://crbug.com/462082 is diagnosed. |
| 17 var doodleData = null; | 17 var doodleData = null; |
| 18 | 18 |
| 19 /** | 19 /** |
| 20 * Initialize the page. | 20 * Initialize the page. |
| 21 */ | 21 */ |
| 22 function initialize() { | 22 function initialize() { |
| 23 chrome.send('initialize'); | 23 chrome.send('initialize'); |
| 24 } | 24 } |
| 25 | 25 |
| 26 /** | 26 /** |
| 27 * Invoked when the hotword plugin availability is changed. | |
| 28 * | |
| 29 * @param {boolean} enabled Whether the plugin is enabled or not. | |
| 30 */ | |
| 31 function setHotwordEnabled(enabled) { | |
| 32 } | |
| 33 | |
| 34 /** | |
| 35 * Sets the architecture of NaCl module to be loaded for hotword. | |
| 36 * @param {string} arch The architecture. | |
| 37 */ | |
| 38 function setNaclArch(arch) { | |
| 39 } | |
| 40 | |
| 41 /** | |
| 42 * Invoked when the app-list bubble is shown. | 27 * Invoked when the app-list bubble is shown. |
| 43 * | |
| 44 * @param {boolean} hotwordEnabled Whether the hotword is enabled or not. | |
| 45 */ | 28 */ |
| 46 function onAppListShown(hotwordEnabled, legacySpeechEnabled) { | 29 function onAppListShown() { |
| 47 | |
| 48 chrome.send('appListShown', [this.doodle != null]); | 30 chrome.send('appListShown', [this.doodle != null]); |
| 49 } | 31 } |
| 50 | 32 |
| 51 /** | 33 /** |
| 52 * Sets the doodle's visibility, hiding or showing the default logo. | 34 * Sets the doodle's visibility, hiding or showing the default logo. |
| 53 * | 35 * |
| 54 * @param {boolean} visible Whether the doodle should be made visible. | 36 * @param {boolean} visible Whether the doodle should be made visible. |
| 55 */ | 37 */ |
| 56 function setDoodleVisible(visible) { | 38 function setDoodleVisible(visible) { |
| 57 var doodle = $('doodle'); | 39 var doodle = $('doodle'); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 chrome.send('doodleClicked'); | 97 chrome.send('doodleClicked'); |
| 116 return true; | 98 return true; |
| 117 }; | 99 }; |
| 118 this.doodle.appendChild(doodleLink); | 100 this.doodle.appendChild(doodleLink); |
| 119 } else { | 101 } else { |
| 120 this.doodle.appendChild(doodleImage); | 102 this.doodle.appendChild(doodleImage); |
| 121 } | 103 } |
| 122 $('logo_container').appendChild(this.doodle); | 104 $('logo_container').appendChild(this.doodle); |
| 123 } | 105 } |
| 124 | 106 |
| 125 /** | |
| 126 * Invoked when the app-list bubble is hidden. | |
| 127 */ | |
| 128 function onAppListHidden() { | |
| 129 } | |
| 130 | |
| 131 /** | |
| 132 * Invoked when the user explicitly wants to toggle the speech recognition | |
| 133 * state. | |
| 134 */ | |
| 135 function toggleSpeechRecognition() { | |
| 136 } | |
| 137 | |
| 138 return { | 107 return { |
| 139 initialize: initialize, | 108 initialize: initialize, |
| 140 setHotwordEnabled: setHotwordEnabled, | |
| 141 setNaclArch: setNaclArch, | |
| 142 onAppListDoodleUpdated: onAppListDoodleUpdated, | 109 onAppListDoodleUpdated: onAppListDoodleUpdated, |
| 143 onAppListShown: onAppListShown, | 110 onAppListShown: onAppListShown, |
| 144 onAppListHidden: onAppListHidden, | |
| 145 toggleSpeechRecognition: toggleSpeechRecognition | |
| 146 }; | 111 }; |
| 147 }); | 112 }); |
| 148 | 113 |
| 149 // TODO(calamity): Suppress context the menu once http://crbug.com/462082 is | 114 // TODO(calamity): Suppress context the menu once http://crbug.com/462082 is |
| 150 // diagnosed. | 115 // diagnosed. |
| 151 document.addEventListener('DOMContentLoaded', appList.startPage.initialize); | 116 document.addEventListener('DOMContentLoaded', appList.startPage.initialize); |
| OLD | NEW |