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( |
Dan Beam
2014/08/14 19:01:26
^ why are we doing this in JS instead of in C++ an
ericzeng
2014/08/14 22:34:13
Is there a convenient way to send the flags check
Devlin
2014/08/15 15:19:50
Since this is in ExtensionsList, we could just set
not at google - send to devlin
2014/08/15 15:51:06
I kind of like this using an extension API :) less
ericzeng
2014/08/15 18:05:25
Done.
| |
197 'enable-embedded-extension-options', function(result) { | |
Dan Beam
2014/08/14 19:01:26
chrome.commandLinePrivate.hasSwitch(
'enable-e
ericzeng
2014/08/14 22:34:13
Done.
| |
198 if (result) { | |
199 extensions.ExtensionOptionsOverlay.getInstance() | |
200 .setExtensionAndShowOverlay([extension.id], extension.name); | |
Dan Beam
2014/08/14 19:01:26
dot at end:
extensions.ExtensionOptionsOverlay.ge
ericzeng
2014/08/14 22:34:13
Done.
| |
201 } else { | |
202 chrome.send('extensionSettingsOptions', [extension.id]); | |
203 } | |
204 }); | |
197 e.preventDefault(); | 205 e.preventDefault(); |
198 }); | 206 }); |
199 options.hidden = false; | 207 options.hidden = false; |
200 } | 208 } |
201 | 209 |
202 // The 'Permissions' link. | 210 // The 'Permissions' link. |
203 var permissions = node.querySelector('.permissions-link'); | 211 var permissions = node.querySelector('.permissions-link'); |
204 permissions.addEventListener('click', function(e) { | 212 permissions.addEventListener('click', function(e) { |
205 chrome.send('extensionSettingsPermissions', [extension.id]); | 213 chrome.send('extensionSettingsPermissions', [extension.id]); |
206 e.preventDefault(); | 214 e.preventDefault(); |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
406 topScroll -= pad / 2; | 414 topScroll -= pad / 2; |
407 setScrollTopForDocument(document, topScroll); | 415 setScrollTopForDocument(document, topScroll); |
408 } | 416 } |
409 }, | 417 }, |
410 }; | 418 }; |
411 | 419 |
412 return { | 420 return { |
413 ExtensionsList: ExtensionsList | 421 ExtensionsList: ExtensionsList |
414 }; | 422 }; |
415 }); | 423 }); |
OLD | NEW |