OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // TODO(kochi): Generalize the notification as a component and put it | 5 // TODO(kochi): Generalize the notification as a component and put it |
6 // in js/cr/ui/notification.js . | 6 // in js/cr/ui/notification.js . |
7 | 7 |
8 cr.define('options', function() { | 8 cr.define('options', function() { |
9 /** @const */ var OptionsPage = options.OptionsPage; | 9 /** @const */ var OptionsPage = options.OptionsPage; |
10 /** @const */ var LanguageList = options.LanguageList; | 10 /** @const */ var LanguageList = options.LanguageList; |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 | 289 |
290 // Add the configure button if the config page is present for this | 290 // Add the configure button if the config page is present for this |
291 // input method. | 291 // input method. |
292 if (inputMethod.id in INPUT_METHOD_ID_TO_CONFIG_PAGE_NAME) { | 292 if (inputMethod.id in INPUT_METHOD_ID_TO_CONFIG_PAGE_NAME) { |
293 var pageName = INPUT_METHOD_ID_TO_CONFIG_PAGE_NAME[inputMethod.id]; | 293 var pageName = INPUT_METHOD_ID_TO_CONFIG_PAGE_NAME[inputMethod.id]; |
294 var button = this.createConfigureInputMethodButton_(inputMethod.id, | 294 var button = this.createConfigureInputMethodButton_(inputMethod.id, |
295 pageName); | 295 pageName); |
296 element.appendChild(button); | 296 element.appendChild(button); |
297 } | 297 } |
298 | 298 |
| 299 if (inputMethod.optionsPage) { |
| 300 var button = document.createElement('button'); |
| 301 button.textContent = loadTimeData.getString('configure'); |
| 302 button.onclick = function(e) { |
| 303 window.open(inputMethod.optionsPage); |
| 304 }; |
| 305 element.appendChild(button); |
| 306 } |
| 307 |
299 // Listen to user clicks. | 308 // Listen to user clicks. |
300 input.addEventListener('click', | 309 input.addEventListener('click', |
301 this.handleCheckboxClick_.bind(this)); | 310 this.handleCheckboxClick_.bind(this)); |
302 inputMethodList.appendChild(element); | 311 inputMethodList.appendChild(element); |
303 } | 312 } |
304 }, | 313 }, |
305 | 314 |
306 /** | 315 /** |
307 * Creates a configure button for the given input method ID. | 316 * Creates a configure button for the given input method ID. |
308 * @param {string} inputMethodId Input method ID (ex. "pinyin"). | 317 * @param {string} inputMethodId Input method ID (ex. "pinyin"). |
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1148 | 1157 |
1149 LanguageOptions.onDictionaryDownloadFailure = function(languageCode) { | 1158 LanguageOptions.onDictionaryDownloadFailure = function(languageCode) { |
1150 LanguageOptions.getInstance().onDictionaryDownloadFailure_(languageCode); | 1159 LanguageOptions.getInstance().onDictionaryDownloadFailure_(languageCode); |
1151 }; | 1160 }; |
1152 | 1161 |
1153 // Export | 1162 // Export |
1154 return { | 1163 return { |
1155 LanguageOptions: LanguageOptions | 1164 LanguageOptions: LanguageOptions |
1156 }; | 1165 }; |
1157 }); | 1166 }); |
OLD | NEW |