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

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

Issue 8417029: Make settings page more touch friendly (font-size, checkbox, radio, adding language page). (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: revision for code review Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 OptionsPage = options.OptionsPage; 9 const OptionsPage = options.OptionsPage;
10 const LanguageList = options.LanguageList; 10 const LanguageList = options.LanguageList;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // the URL hash (ex. lang_add=ja). Used for automated testing. 70 // the URL hash (ex. lang_add=ja). Used for automated testing.
71 var match = document.location.hash.match(/\blang_add=([\w-]+)/); 71 var match = document.location.hash.match(/\blang_add=([\w-]+)/);
72 if (match) { 72 if (match) {
73 var addLanguageCode = match[1]; 73 var addLanguageCode = match[1];
74 $('language-options-list').addLanguage(addLanguageCode); 74 $('language-options-list').addLanguage(addLanguageCode);
75 } else { 75 } else {
76 OptionsPage.navigateToPage('addLanguage'); 76 OptionsPage.navigateToPage('addLanguage');
77 } 77 }
78 }; 78 };
79 79
80 if (cr.isChromeOS) { 80 if (cr.isChromeOS && !cr.isTouch) {
81 // Listen to user clicks on the add language list. 81 // Listen to user clicks on the add language list.
82 var addLanguageList = $('add-language-overlay-language-list'); 82 var addLanguageList = $('add-language-overlay-language-list');
83 addLanguageList.addEventListener('click', 83 addLanguageList.addEventListener('click',
84 this.handleAddLanguageListClick_.bind(this)); 84 this.handleAddLanguageListClick_.bind(this));
85 } else {
86 // Listen to add language dialog ok button.
87 var addLanguageOkButton = $('add-language-overlay-ok-button');
88 addLanguageOkButton.addEventListener('click',
89 this.handleAddLanguageOkButtonClick_.bind(this));
90
85 // Listen to user clicks on the "Change touch keyboard settings..." 91 // Listen to user clicks on the "Change touch keyboard settings..."
86 // button. 92 // button.
87 if (cr.isTouch) { 93 if (cr.isChromeOS && cr.isTouch) {
88 var virtualKeyboardButton = $('language-options-virtual-keyboard'); 94 var virtualKeyboardButton = $('language-options-virtual-keyboard');
89 // TODO(yusukes): would be better to hide the button if no virtual 95 // TODO(yusukes): would be better to hide the button if no virtual
90 // keyboard is registered. 96 // keyboard is registered.
91 virtualKeyboardButton.onclick = function(e) { 97 virtualKeyboardButton.onclick = function(e) {
92 OptionsPage.navigateToPage('virtualKeyboards'); 98 OptionsPage.navigateToPage('virtualKeyboards');
93 }; 99 };
94 } 100 } else {
95 } else { 101 // Show experimental features if enabled.
96 // Listen to add language dialog ok button. 102 if (templateData.experimentalSpellCheckFeatures == 'true') {
James Hawkins 2011/10/31 04:36:20 nit: No braces for single-line blocks.
bshe 2011/10/31 14:18:21 Done.
97 var addLanguageOkButton = $('add-language-overlay-ok-button'); 103 $('auto-spell-correction-option').hidden = false;
98 addLanguageOkButton.addEventListener('click', 104 }
99 this.handleAddLanguageOkButtonClick_.bind(this));
100
101 // Show experimental features if enabled.
102 if (templateData.experimentalSpellCheckFeatures == 'true') {
103 $('auto-spell-correction-option').hidden = false;
104 } 105 }
105 } 106 }
106 107
107 if(!cr.isChromeOS) { 108 if(!cr.isChromeOS) {
108 // Handle spell check enable/disable. 109 // Handle spell check enable/disable.
109 Preferences.getInstance().addEventListener(this.enableSpellCheckPref, 110 Preferences.getInstance().addEventListener(this.enableSpellCheckPref,
110 this.updateEnableSpellCheck_.bind(this)); 111 this.updateEnableSpellCheck_.bind(this));
111 } 112 }
112 }, 113 },
113 114
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
804 LanguageOptions.uiLanguageSaved = function() { 805 LanguageOptions.uiLanguageSaved = function() {
805 $('language-options-ui-language-button').style.display = 'none'; 806 $('language-options-ui-language-button').style.display = 'none';
806 $('language-options-ui-notification-bar').style.display = 'block'; 807 $('language-options-ui-notification-bar').style.display = 'block';
807 }; 808 };
808 809
809 // Export 810 // Export
810 return { 811 return {
811 LanguageOptions: LanguageOptions 812 LanguageOptions: LanguageOptions
812 }; 813 };
813 }); 814 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/language_options.css ('k') | chrome/browser/resources/options/options_page.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698