| 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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 | 318 |
| 319 var input = element.querySelector('input'); | 319 var input = element.querySelector('input'); |
| 320 input.inputMethodId = inputMethod.id; | 320 input.inputMethodId = inputMethod.id; |
| 321 var span = element.querySelector('span'); | 321 var span = element.querySelector('span'); |
| 322 span.textContent = inputMethod.displayName; | 322 span.textContent = inputMethod.displayName; |
| 323 | 323 |
| 324 if (inputMethod.optionsPage) { | 324 if (inputMethod.optionsPage) { |
| 325 var button = document.createElement('button'); | 325 var button = document.createElement('button'); |
| 326 button.textContent = loadTimeData.getString('configure'); | 326 button.textContent = loadTimeData.getString('configure'); |
| 327 button.inputMethodId = inputMethod.id; | 327 button.inputMethodId = inputMethod.id; |
| 328 button.onclick = function(inputMethodId, e) { | 328 button.onclick = function(id, optionsPage, e) { |
| 329 chrome.send('inputMethodOptionsOpen', [inputMethodId]); | 329 chrome.send('inputMethodOptionsOpen', [id, optionsPage]); |
| 330 }.bind(this, inputMethod.id); | 330 }.bind(this, inputMethod.id, inputMethod.optionsPage); |
| 331 element.appendChild(button); | 331 element.appendChild(button); |
| 332 } | 332 } |
| 333 | 333 |
| 334 // Listen to user clicks. | 334 // Listen to user clicks. |
| 335 input.addEventListener('click', | 335 input.addEventListener('click', |
| 336 this.handleCheckboxClick_.bind(this)); | 336 this.handleCheckboxClick_.bind(this)); |
| 337 inputMethodList.appendChild(element); | 337 inputMethodList.appendChild(element); |
| 338 } | 338 } |
| 339 }, | 339 }, |
| 340 | 340 |
| (...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1295 | 1295 |
| 1296 LanguageOptions.onComponentManagerInitialized = function(componentImes) { | 1296 LanguageOptions.onComponentManagerInitialized = function(componentImes) { |
| 1297 LanguageOptions.getInstance().appendComponentExtensionIme_(componentImes); | 1297 LanguageOptions.getInstance().appendComponentExtensionIme_(componentImes); |
| 1298 }; | 1298 }; |
| 1299 | 1299 |
| 1300 // Export | 1300 // Export |
| 1301 return { | 1301 return { |
| 1302 LanguageOptions: LanguageOptions | 1302 LanguageOptions: LanguageOptions |
| 1303 }; | 1303 }; |
| 1304 }); | 1304 }); |
| OLD | NEW |