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

Side by Side Diff: chrome/browser/resources/options2/chromeos/accounts_options.js

Issue 9464053: Hide/Disable several (meaningless) options in Settings uber-page for Guest. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: No change picture button anymore Created 8 years, 10 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
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 cr.define('options', function() { 5 cr.define('options', function() {
6 var OptionsPage = options.OptionsPage; 6 var OptionsPage = options.OptionsPage;
7 7
8 ///////////////////////////////////////////////////////////////////////////// 8 /////////////////////////////////////////////////////////////////////////////
9 // AccountsOptions class: 9 // AccountsOptions class:
10 10
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 153
154 /** 154 /**
155 * Update account picture. 155 * Update account picture.
156 * @param {string} username User for which to update the image. 156 * @param {string} username User for which to update the image.
157 */ 157 */
158 AccountsOptions.updateAccountPicture = function(username) { 158 AccountsOptions.updateAccountPicture = function(username) {
159 if (this.showWhitelist_) 159 if (this.showWhitelist_)
160 $('userList').updateAccountPicture(username); 160 $('userList').updateAccountPicture(username);
161 }; 161 };
162 162
163 /**
164 * Disable and mark page elements that does not make sense in Guest mode.
James Hawkins 2012/02/28 20:03:35 s/does/do/
James Hawkins 2012/02/28 20:03:35 Don't use statements about things 'making sense' i
Denis Kuznetsov (DE-MUC) 2012/02/29 08:41:43 Done.
Denis Kuznetsov (DE-MUC) 2012/02/29 08:41:43 Done.
165 */
166 AccountsOptions.disableElementsForGuest = function(element) {
James Hawkins 2012/02/28 20:03:35 Document |element|.
Denis Kuznetsov (DE-MUC) 2012/02/29 08:41:43 Done.
167 AccountsOptions.disableElementForGuest_(element);
168
169 // Walk the tree, searching each ELEMENT node.
170 var walker = document.createTreeWalker(element,
171 NodeFilter.SHOW_ELEMENT,
172 null,
173 false);
174
175 var node = walker.nextNode();
176 while (node) {
177 AccountsOptions.disableElementForGuest_(node);
178 node = walker.nextNode();
179 }
180 };
181
182 AccountsOptions.disableElementForGuest_ = function(element) {
James Hawkins 2012/02/28 20:03:35 Document method.
Denis Kuznetsov (DE-MUC) 2012/02/29 08:41:43 Done.
183 element.classList.add('guest-disabled')
184 if (element.nodeName == 'INPUT' ||
185 element.nodeName == 'SELECT' ||
186 element.nodeName == 'BUTTON')
187 element.disabled = true;
188 if (element.nodeName == 'A')
189 element.removeAttribute('href');
190 };
191
163 // Export 192 // Export
164 return { 193 return {
165 AccountsOptions: AccountsOptions 194 AccountsOptions: AccountsOptions
166 }; 195 };
167 196
168 }); 197 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698