diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-16 10:20:01 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-16 10:20:01 +0000 |
commit | c7c401dd5f78685f7ce4a1e1ba0b38f64702c73e (patch) | |
tree | 14fea4d07b6b4375da8bc4bf65f27268409b2034 /chrome/browser/extensions/extension_module.cc | |
parent | cdefa460b361c452c20249b672afeda499886f60 (diff) | |
download | chromium_src-c7c401dd5f78685f7ce4a1e1ba0b38f64702c73e.zip chromium_src-c7c401dd5f78685f7ce4a1e1ba0b38f64702c73e.tar.gz chromium_src-c7c401dd5f78685f7ce4a1e1ba0b38f64702c73e.tar.bz2 |
Exposing extension preferences via the `chrome.extension` API.
`chrome.extension.isAllowedIncognitoAccess` gives access to `chrome://extension`'s "Allowed in Incognito" checkbox's state, and `chrome.extension.isAllowedFileSchemeAccess` does the same for "Allow access to File URLs".
Patch by Mike West <mkwst@google.com>.
BUG=74694
TEST=Create an extension that checks whether 'Allow in Incognito' or 'Allow access to File URLs' is checked. It should work correctly.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78347 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_module.cc')
-rw-r--r-- | chrome/browser/extensions/extension_module.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/extensions/extension_module.cc b/chrome/browser/extensions/extension_module.cc index 1ef27a9..bb13067 100644 --- a/chrome/browser/extensions/extension_module.cc +++ b/chrome/browser/extensions/extension_module.cc @@ -21,3 +21,21 @@ bool SetUpdateUrlDataFunction::RunImpl() { extension_prefs()->SetUpdateUrlData(extension_id(), data); return true; } + +bool IsAllowedIncognitoAccessFunction::RunImpl() { + ExtensionService* ext_service = profile()->GetExtensionService(); + const Extension* extension = GetExtension(); + + result_.reset(Value::CreateBooleanValue( + ext_service->IsIncognitoEnabled(extension))); + return true; +} + +bool IsAllowedFileSchemeAccessFunction::RunImpl() { + ExtensionService* ext_service = profile()->GetExtensionService(); + const Extension* extension = GetExtension(); + + result_.reset(Value::CreateBooleanValue( + ext_service->AllowFileAccess(extension))); + return true; +} |