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

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

Issue 997183005: [Extensions] Add a developerPrivate.updateExtensionConfiguration function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 <include src="extension_error.js"> 5 <include src="extension_error.js">
6 6
7 /////////////////////////////////////////////////////////////////////////////// 7 ///////////////////////////////////////////////////////////////////////////////
8 // ExtensionFocusRow: 8 // ExtensionFocusRow:
9 9
10 /** 10 /**
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 var template = $('template-collection').querySelector( 304 var template = $('template-collection').querySelector(
305 '.extension-list-item-wrapper'); 305 '.extension-list-item-wrapper');
306 var node = template.cloneNode(true); 306 var node = template.cloneNode(true);
307 ExtensionFocusRow.decorate(node, $('extension-settings-list')); 307 ExtensionFocusRow.decorate(node, $('extension-settings-list'));
308 308
309 var row = assertInstanceof(node, ExtensionFocusRow); 309 var row = assertInstanceof(node, ExtensionFocusRow);
310 row.id = extension.id; 310 row.id = extension.id;
311 311
312 // The 'Show Browser Action' button. 312 // The 'Show Browser Action' button.
313 row.setupColumn('.show-button', 'showButton', 'click', function(e) { 313 row.setupColumn('.show-button', 'showButton', 'click', function(e) {
314 chrome.send('extensionSettingsShowButton', [extension.id]); 314 chrome.developerPrivate.setExtensionPermission({
315 extensionId: extension.id,
316 permission: chrome.developerPrivate.PermissionType.SHOW_ACTION_BUTTON,
317 isActive: true
318 });
315 }); 319 });
316 320
317 // The 'allow in incognito' checkbox. 321 // The 'allow in incognito' checkbox.
318 row.setupColumn('.incognito-control input', 'incognito', 'change', 322 row.setupColumn('.incognito-control input', 'incognito', 'change',
319 function(e) { 323 function(e) {
320 var butterBar = row.querySelector('.butter-bar'); 324 var butterBar = row.querySelector('.butter-bar');
321 var checked = e.target.checked; 325 var checked = e.target.checked;
322 if (!this.butterbarShown_) { 326 if (!this.butterbarShown_) {
323 butterBar.hidden = !checked || 327 butterBar.hidden = !checked ||
324 extension.type == 328 extension.type ==
325 chrome.developerPrivate.ExtensionType.HOSTED_APP; 329 chrome.developerPrivate.ExtensionType.HOSTED_APP;
326 this.butterbarShown_ = !butterBar.hidden; 330 this.butterbarShown_ = !butterBar.hidden;
327 } else { 331 } else {
328 butterBar.hidden = true; 332 butterBar.hidden = true;
329 } 333 }
330 chrome.developerPrivate.allowIncognito(extension.id, checked); 334 chrome.developerPrivate.setExtensionPermission({
335 extensionId: extension.id,
336 permission: chrome.developerPrivate.PermissionType.INCOGNITO_ACCESS,
337 isActive: e.target.checked
338 });
331 }.bind(this)); 339 }.bind(this));
332 340
333 // The 'collect errors' checkbox. This should only be visible if the 341 // The 'collect errors' checkbox. This should only be visible if the
334 // error console is enabled - we can detect this by the existence of the 342 // error console is enabled - we can detect this by the existence of the
335 // |errorCollectionEnabled| property. 343 // |errorCollectionEnabled| property.
336 row.setupColumn('.error-collection-control input', 'dev-collectErrors', 344 row.setupColumn('.error-collection-control input', 'dev-collectErrors',
337 'change', function(e) { 345 'change', function(e) {
338 chrome.send('extensionSettingsEnableErrorCollection', 346 chrome.developerPrivate.setExtensionPermission({
339 [extension.id, String(e.target.checked)]); 347 extensionId: extension.id,
348 permission: chrome.developerPrivate.PermissionType.ERROR_COLLECTION,
349 isActive: e.target.checked
350 });
340 }); 351 });
341 352
342 // The 'allow on all urls' checkbox. This should only be visible if 353 // The 'allow on all urls' checkbox. This should only be visible if
343 // active script restrictions are enabled. If they are not enabled, no 354 // active script restrictions are enabled. If they are not enabled, no
344 // extensions should want all urls. 355 // extensions should want all urls.
345 row.setupColumn('.all-urls-control input', 'allUrls', 'click', 356 row.setupColumn('.all-urls-control input', 'allUrls', 'click',
346 function(e) { 357 function(e) {
347 chrome.send('extensionSettingsAllowOnAllUrls', 358 chrome.developerPrivate.setExtensionPermission({
348 [extension.id, String(e.target.checked)]); 359 extensionId: extension.id,
360 permission: chrome.developerPrivate.PermissionType.RUN_ON_ALL_URLS,
361 isActive: e.target.checked
362 });
349 }); 363 });
350 364
351 // The 'allow file:// access' checkbox. 365 // The 'allow file:// access' checkbox.
352 row.setupColumn('.file-access-control input', 'localUrls', 'click', 366 row.setupColumn('.file-access-control input', 'localUrls', 'click',
353 function(e) { 367 function(e) {
354 chrome.developerPrivate.allowFileAccess(extension.id, e.target.checked); 368 chrome.developerPrivate.setExtensionPermission({
369 extensionId: extension.id,
370 permission: chrome.developerPrivate.PermissionType.FILE_ACCESS,
371 isActive: e.target.checked
372 });
355 }); 373 });
356 374
357 // The 'Options' button or link, depending on its behaviour. 375 // The 'Options' button or link, depending on its behaviour.
358 // Set an href to get the correct mouse-over appearance (link, 376 // Set an href to get the correct mouse-over appearance (link,
359 // footer) - but the actual link opening is done through chrome.send 377 // footer) - but the actual link opening is done through chrome.send
360 // with a preventDefault(). 378 // with a preventDefault().
361 row.querySelector('.options-link').href = 379 row.querySelector('.options-link').href =
362 extension.optionsPage ? extension.optionsPage.url : ''; 380 extension.optionsPage ? extension.optionsPage.url : '';
363 row.setupColumn('.options-link', 'options', 'click', function(e) { 381 row.setupColumn('.options-link', 'options', 'click', function(e) {
364 chrome.send('extensionSettingsOptions', [extension.id]); 382 chrome.send('extensionSettingsOptions', [extension.id]);
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 // TODO(dbeam): why do we need to focus <extensionoptions> before and 921 // TODO(dbeam): why do we need to focus <extensionoptions> before and
904 // after its showing animation? Makes very little sense to me. 922 // after its showing animation? Makes very little sense to me.
905 overlay.setInitialFocus(); 923 overlay.setInitialFocus();
906 }, 924 },
907 }; 925 };
908 926
909 return { 927 return {
910 ExtensionList: ExtensionList 928 ExtensionList: ExtensionList
911 }; 929 };
912 }); 930 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698