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

Side by Side Diff: chrome/browser/resources/extensions/extensions.js

Issue 12288052: Add managed user lock/unlock button for the extensions page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address css nit. Created 7 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 | Annotate | Revision Log
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 <include src="../uber/uber_utils.js"></include> 5 <include src="../uber/uber_utils.js"></include>
6 <include src="extension_commands_overlay.js"></include> 6 <include src="extension_commands_overlay.js"></include>
7 <include src="extension_focus_manager.js"></include> 7 <include src="extension_focus_manager.js"></include>
8 <include src="extension_list.js"></include> 8 <include src="extension_list.js"></include>
9 <include src="pack_extension_overlay.js"></include> 9 <include src="pack_extension_overlay.js"></include>
10 10
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 // This will request the data to show on the page and will get a response 81 // This will request the data to show on the page and will get a response
82 // back in returnExtensionsData. 82 // back in returnExtensionsData.
83 chrome.send('extensionSettingsRequestExtensionsData'); 83 chrome.send('extensionSettingsRequestExtensionsData');
84 84
85 $('toggle-dev-on').addEventListener('change', 85 $('toggle-dev-on').addEventListener('change',
86 this.handleToggleDevMode_.bind(this)); 86 this.handleToggleDevMode_.bind(this));
87 $('dev-controls').addEventListener('webkitTransitionEnd', 87 $('dev-controls').addEventListener('webkitTransitionEnd',
88 this.handleDevControlsTransitionEnd_.bind(this)); 88 this.handleDevControlsTransitionEnd_.bind(this));
89 89
90 $('unlock-button').onclick = function() {
not at google - send to devlin 2013/02/21 01:29:18 .addEventListener('click', function(){...})
Adrian Kuegel 2013/02/21 10:10:54 Done.
91 chrome.send('authenticate');
92 };
93
94 $('lock-button').onclick = function() {
not at google - send to devlin 2013/02/21 01:29:18 ditto
Adrian Kuegel 2013/02/21 10:10:54 Done.
95 chrome.send('endAuthentication');
96 };
97
90 // Set up the three dev mode buttons (load unpacked, pack and update). 98 // Set up the three dev mode buttons (load unpacked, pack and update).
91 $('load-unpacked').addEventListener('click', 99 $('load-unpacked').addEventListener('click',
92 this.handleLoadUnpackedExtension_.bind(this)); 100 this.handleLoadUnpackedExtension_.bind(this));
93 $('pack-extension').addEventListener('click', 101 $('pack-extension').addEventListener('click',
94 this.handlePackExtension_.bind(this)); 102 this.handlePackExtension_.bind(this));
95 $('update-extensions-now').addEventListener('click', 103 $('update-extensions-now').addEventListener('click',
96 this.handleUpdateExtensionNow_.bind(this)); 104 this.handleUpdateExtensionNow_.bind(this));
97 105
98 if (!loadTimeData.getBoolean('offStoreInstallEnabled')) { 106 if (!loadTimeData.getBoolean('offStoreInstallEnabled')) {
99 this.dragWrapper_ = new cr.ui.DragWrapper(document.documentElement, 107 this.dragWrapper_ = new cr.ui.DragWrapper(document.documentElement,
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 b = b.name.toLowerCase(); 245 b = b.name.toLowerCase();
238 return a < b ? -1 : (a > b ? 1 : 0); 246 return a < b ? -1 : (a > b ? 1 : 0);
239 } else { 247 } else {
240 return a.order < b.order ? -1 : 1; 248 return a.order < b.order ? -1 : 1;
241 } 249 }
242 }); 250 });
243 } 251 }
244 252
245 var pageDiv = $('extension-settings'); 253 var pageDiv = $('extension-settings');
246 var marginTop = 0; 254 var marginTop = 0;
247 if (extensionsData.profileIsManaged) { 255 if (extensionsData.profileIsManaged && !extensionsData.profileIsElevated) {
248 pageDiv.classList.add('showing-banner'); 256 pageDiv.classList.add('showing-banner');
249 pageDiv.classList.add('profile-is-managed'); 257 pageDiv.classList.add('profile-is-managed');
250 $('toggle-dev-on').disabled = true; 258 $('toggle-dev-on').disabled = true;
251 marginTop += 45; 259 marginTop += 48;
252 } else { 260 } else {
253 pageDiv.classList.remove('showing-banner'); 261 pageDiv.classList.remove('showing-banner');
254 pageDiv.classList.remove('profile-is-managed'); 262 pageDiv.classList.remove('profile-is-managed');
255 $('toggle-dev-on').disabled = false; 263 $('toggle-dev-on').disabled = false;
264 if (!extensionsData.profileIsManaged) {
265 pageDiv.classList.add('no-managed-user-controls');
266 }
not at google - send to devlin 2013/02/21 01:29:18 I find this more confusing than it needs to be, I
Adrian Kuegel 2013/02/21 10:10:54 I agree, using profile-is-managed instead of no-ma
256 } 267 }
257 268
258 if (extensionsData.showDisabledExtensionsWarning) { 269 if (extensionsData.showDisabledExtensionsWarning) {
259 pageDiv.classList.add('showing-banner'); 270 pageDiv.classList.add('showing-banner');
260 pageDiv.classList.add('sideload-wipeout'); 271 pageDiv.classList.add('sideload-wipeout');
261 marginTop += 60; 272 marginTop += 60;
262 } 273 }
263 pageDiv.style.marginTop = marginTop + 'px'; 274 pageDiv.style.marginTop = marginTop + 'px';
264 275
265 if (extensionsData.developerMode && !extensionsData.profileIsManaged) { 276 if (extensionsData.developerMode) {
266 pageDiv.classList.add('dev-mode'); 277 pageDiv.classList.add('dev-mode');
267 $('toggle-dev-on').checked = true; 278 $('toggle-dev-on').checked = true;
268 $('dev-controls').hidden = false; 279 $('dev-controls').hidden = false;
269 } else { 280 } else {
270 pageDiv.classList.remove('dev-mode'); 281 pageDiv.classList.remove('dev-mode');
271 $('toggle-dev-on').checked = false; 282 $('toggle-dev-on').checked = false;
272 } 283 }
273 284
274 $('load-unpacked').disabled = extensionsData.loadUnpackedDisabled; 285 $('load-unpacked').disabled = extensionsData.loadUnpackedDisabled;
275 286
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 return { 371 return {
361 ExtensionSettings: ExtensionSettings 372 ExtensionSettings: ExtensionSettings
362 }; 373 };
363 }); 374 });
364 375
365 var ExtensionSettings = extensions.ExtensionSettings; 376 var ExtensionSettings = extensions.ExtensionSettings;
366 377
367 window.addEventListener('load', function(e) { 378 window.addEventListener('load', function(e) {
368 ExtensionSettings.getInstance().initialize(); 379 ExtensionSettings.getInstance().initialize();
369 }); 380 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698