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

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 review comments and rebase to ToT. 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').addEventListener('click', function() {
91 chrome.send('setElevated', [true]);
92 });
93
94 $('lock-button').addEventListener('click', function() {
95 chrome.send('setElevated', [false]);
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)
256 pageDiv.classList.add('profile-is-managed');
not at google - send to devlin 2013/02/21 16:25:24 does this need an else: classList.remove('profile-
Adrian Kuegel 2013/02/21 16:39:00 Currently I think the profile is put in managed st
257 if (extensionsData.profileIsManaged && !extensionsData.profileIsElevated) {
248 pageDiv.classList.add('showing-banner'); 258 pageDiv.classList.add('showing-banner');
249 pageDiv.classList.add('profile-is-managed'); 259 pageDiv.classList.add('managed-user-locked');
250 $('toggle-dev-on').disabled = true; 260 $('toggle-dev-on').disabled = true;
251 marginTop += 45; 261 marginTop += 45;
252 } else { 262 } else {
253 pageDiv.classList.remove('showing-banner'); 263 pageDiv.classList.remove('showing-banner');
254 pageDiv.classList.remove('profile-is-managed'); 264 pageDiv.classList.remove('managed-user-locked');
255 $('toggle-dev-on').disabled = false; 265 $('toggle-dev-on').disabled = false;
256 } 266 }
257 267
258 if (extensionsData.showDisabledExtensionsWarning) { 268 if (extensionsData.showDisabledExtensionsWarning) {
259 pageDiv.classList.add('showing-banner'); 269 pageDiv.classList.add('showing-banner');
260 pageDiv.classList.add('sideload-wipeout'); 270 pageDiv.classList.add('sideload-wipeout');
261 marginTop += 60; 271 marginTop += 60;
262 } 272 }
263 pageDiv.style.marginTop = marginTop + 'px'; 273 pageDiv.style.marginTop = marginTop + 'px';
264 274
265 if (extensionsData.developerMode && !extensionsData.profileIsManaged) { 275 if (extensionsData.developerMode) {
266 pageDiv.classList.add('dev-mode'); 276 pageDiv.classList.add('dev-mode');
267 $('toggle-dev-on').checked = true; 277 $('toggle-dev-on').checked = true;
268 $('dev-controls').hidden = false; 278 $('dev-controls').hidden = false;
269 } else { 279 } else {
270 pageDiv.classList.remove('dev-mode'); 280 pageDiv.classList.remove('dev-mode');
271 $('toggle-dev-on').checked = false; 281 $('toggle-dev-on').checked = false;
272 } 282 }
273 283
274 $('load-unpacked').disabled = extensionsData.loadUnpackedDisabled; 284 $('load-unpacked').disabled = extensionsData.loadUnpackedDisabled;
275 285
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 return { 370 return {
361 ExtensionSettings: ExtensionSettings 371 ExtensionSettings: ExtensionSettings
362 }; 372 };
363 }); 373 });
364 374
365 var ExtensionSettings = extensions.ExtensionSettings; 375 var ExtensionSettings = extensions.ExtensionSettings;
366 376
367 window.addEventListener('load', function(e) { 377 window.addEventListener('load', function(e) {
368 ExtensionSettings.getInstance().initialize(); 378 ExtensionSettings.getInstance().initialize();
369 }); 379 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698