| OLD | NEW |
| 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 cr.define('options', function() { | 7 cr.define('options', function() { |
| 8 'use strict'; | 8 'use strict'; |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 [extension.id, String(e.target.checked)]); | 186 [extension.id, String(e.target.checked)]); |
| 187 }); | 187 }); |
| 188 fileAccess.querySelector('input').checked = extension.allowFileAccess; | 188 fileAccess.querySelector('input').checked = extension.allowFileAccess; |
| 189 fileAccess.hidden = false; | 189 fileAccess.hidden = false; |
| 190 } | 190 } |
| 191 | 191 |
| 192 // The 'Options' link. | 192 // The 'Options' link. |
| 193 if (extension.enabled && extension.optionsUrl) { | 193 if (extension.enabled && extension.optionsUrl) { |
| 194 var options = node.querySelector('.options-link'); | 194 var options = node.querySelector('.options-link'); |
| 195 options.addEventListener('click', function(e) { | 195 options.addEventListener('click', function(e) { |
| 196 chrome.send('extensionSettingsOptions', [extension.id]); | 196 chrome.commandLinePrivate.hasSwitch( |
| 197 'enable-embedded-extension-options', |
| 198 function(result) { |
| 199 if (result) { |
| 200 extensions.ExtensionOptionsOverlay.getInstance(). |
| 201 setExtensionAndShowOverlay([extension.id], extension.name); |
| 202 } else { |
| 203 chrome.send('extensionSettingsOptions', [extension.id]); |
| 204 } |
| 205 }); |
| 197 e.preventDefault(); | 206 e.preventDefault(); |
| 198 }); | 207 }); |
| 199 options.hidden = false; | 208 options.hidden = false; |
| 200 } | 209 } |
| 201 | 210 |
| 202 // The 'Permissions' link. | 211 // The 'Permissions' link. |
| 203 var permissions = node.querySelector('.permissions-link'); | 212 var permissions = node.querySelector('.permissions-link'); |
| 204 permissions.addEventListener('click', function(e) { | 213 permissions.addEventListener('click', function(e) { |
| 205 chrome.send('extensionSettingsPermissions', [extension.id]); | 214 chrome.send('extensionSettingsPermissions', [extension.id]); |
| 206 e.preventDefault(); | 215 e.preventDefault(); |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 topScroll -= pad / 2; | 415 topScroll -= pad / 2; |
| 407 setScrollTopForDocument(document, topScroll); | 416 setScrollTopForDocument(document, topScroll); |
| 408 } | 417 } |
| 409 }, | 418 }, |
| 410 }; | 419 }; |
| 411 | 420 |
| 412 return { | 421 return { |
| 413 ExtensionsList: ExtensionsList | 422 ExtensionsList: ExtensionsList |
| 414 }; | 423 }; |
| 415 }); | 424 }); |
| OLD | NEW |