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

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

Issue 75363002: Set focus to the "OK" button when editing a supervised user profile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/manage_profile_browsertest.js » ('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 cr.define('options', function() { 5 cr.define('options', function() {
6 var OptionsPage = options.OptionsPage; 6 var OptionsPage = options.OptionsPage;
7 var ArrayDataModel = cr.ui.ArrayDataModel; 7 var ArrayDataModel = cr.ui.ArrayDataModel;
8 8
9 /** 9 /**
10 * ManageProfileOverlay class 10 * ManageProfileOverlay class
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 // "remove shortcut" buttons and ask the handler which to show. It will 121 // "remove shortcut" buttons and ask the handler which to show. It will
122 // call |receiveHasProfileShortcuts|, which will show the appropriate one. 122 // call |receiveHasProfileShortcuts|, which will show the appropriate one.
123 $('remove-shortcut-button').hidden = true; 123 $('remove-shortcut-button').hidden = true;
124 $('add-shortcut-button').hidden = true; 124 $('add-shortcut-button').hidden = true;
125 125
126 if (loadTimeData.getBoolean('profileShortcutsEnabled')) { 126 if (loadTimeData.getBoolean('profileShortcutsEnabled')) {
127 var profileInfo = ManageProfileOverlay.getInstance().profileInfo_; 127 var profileInfo = ManageProfileOverlay.getInstance().profileInfo_;
128 chrome.send('requestHasProfileShortcuts', [profileInfo.filePath]); 128 chrome.send('requestHasProfileShortcuts', [profileInfo.filePath]);
129 } 129 }
130 130
131 $('manage-profile-name').focus(); 131 var manageNameField = $('manage-profile-name');
132 // Supervised users cannot edit their names.
133 if (manageNameField.disabled)
134 $('manage-profile-ok').focus();
135 else
136 manageNameField.focus();
132 }, 137 },
133 138
134 /** 139 /**
135 * Registers event handlers that are common between create and manage modes. 140 * Registers event handlers that are common between create and manage modes.
136 * @param {string} mode A label that specifies the type of dialog 141 * @param {string} mode A label that specifies the type of dialog
137 * box which is currently being viewed (i.e. 'create' or 142 * box which is currently being viewed (i.e. 'create' or
138 * 'manage'). 143 * 'manage').
139 * @param {function()} submitFunction The function that should be called 144 * @param {function()} submitFunction The function that should be called
140 * when the user chooses to submit (e.g. by clicking the OK button). 145 * when the user chooses to submit (e.g. by clicking the OK button).
141 * @private 146 * @private
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 return instance[name + '_'].apply(instance, arguments); 699 return instance[name + '_'].apply(instance, arguments);
695 }; 700 };
696 }); 701 });
697 702
698 // Export 703 // Export
699 return { 704 return {
700 ManageProfileOverlay: ManageProfileOverlay, 705 ManageProfileOverlay: ManageProfileOverlay,
701 CreateProfileOverlay: CreateProfileOverlay, 706 CreateProfileOverlay: CreateProfileOverlay,
702 }; 707 };
703 }); 708 });
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/webui/options/manage_profile_browsertest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698