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

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

Issue 8695007: Replace TOUCH_UI condition in WebUI with dynamic flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tiny tweaks based on CR feedback Created 9 years 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 /////////////////////////////////////////////////////////////////////////////// 5 ///////////////////////////////////////////////////////////////////////////////
6 // AddLanguageOverlay class: 6 // AddLanguageOverlay class:
7 7
8 cr.define('options', function() { 8 cr.define('options', function() {
9 const OptionsPage = options.OptionsPage; 9 const OptionsPage = options.OptionsPage;
10 10
(...skipping 30 matching lines...) Expand all
41 var addLanguageList = $('add-language-overlay-language-list'); 41 var addLanguageList = $('add-language-overlay-language-list');
42 var languageListData = templateData.languageList; 42 var languageListData = templateData.languageList;
43 for (var i = 0; i < languageListData.length; i++) { 43 for (var i = 0; i < languageListData.length; i++) {
44 var language = languageListData[i]; 44 var language = languageListData[i];
45 var displayText = language.displayName; 45 var displayText = language.displayName;
46 // If the native name is different, add it. 46 // If the native name is different, add it.
47 if (language.displayName != language.nativeDisplayName) { 47 if (language.displayName != language.nativeDisplayName) {
48 displayText += ' - ' + language.nativeDisplayName; 48 displayText += ' - ' + language.nativeDisplayName;
49 } 49 }
50 50
51 if (cr.isChromeOS && !cr.isTouch) { 51 if (cr.isChromeOS) {
52 var button = document.createElement('button'); 52 var button = document.createElement('button');
53 button.className = 'link-button'; 53 button.className = 'link-button';
54 button.textContent = displayText; 54 button.textContent = displayText;
55 button.languageCode = language.code; 55 button.languageCode = language.code;
56 var li = document.createElement('li'); 56 var li = document.createElement('li');
57 li.languageCode = language.code; 57 li.languageCode = language.code;
58 li.appendChild(button); 58 li.appendChild(button);
59 addLanguageList.appendChild(li); 59 addLanguageList.appendChild(li);
60 } else { 60 } else {
61 var option = document.createElement('option'); 61 var option = document.createElement('option');
62 option.value = language.code; 62 option.value = language.code;
63 option.textContent = displayText; 63 option.textContent = displayText;
64 addLanguageList.appendChild(option); 64 addLanguageList.appendChild(option);
65 } 65 }
66 } 66 }
67 }, 67 },
68 }; 68 };
69 69
70 return { 70 return {
71 AddLanguageOverlay: AddLanguageOverlay 71 AddLanguageOverlay: AddLanguageOverlay
72 }; 72 };
73 }); 73 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698