Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(487)

Side by Side Diff: chrome/browser/resources/options/language_options.js

Issue 14197006: Open input method configuration page in new tab page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/chromeos/cros_language_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698