Chromium Code Reviews| Index: chrome/browser/extensions/api/developer_private/developer_private_api.cc |
| diff --git a/chrome/browser/extensions/api/developer_private/developer_private_api.cc b/chrome/browser/extensions/api/developer_private/developer_private_api.cc |
| index fb75d205dba086a1e4fe19de2248c4e3a7d29652..474a7ebb7be1eb1a21b3373be0c665350ad1f32b 100644 |
| --- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc |
| +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc |
| @@ -409,6 +409,30 @@ bool DeveloperPrivateAllowFileAccessFunction::RunImpl() { |
| DeveloperPrivateAllowFileAccessFunction:: |
| ~DeveloperPrivateAllowFileAccessFunction() {} |
| +bool DeveloperPrivateAllowIncognitoFunction::RunImpl() { |
| + std::string extension_id; |
| + bool allow = false; |
| + EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &extension_id)); |
| + EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(1, &allow)); |
| + |
| + ExtensionService* service = profile()->GetExtensionService(); |
| + const Extension* extension = service->GetInstalledExtension(extension_id); |
| + bool result = true; |
| + |
| + if (!extension) { |
| + result = false; |
| + } else { |
| + service->SetIsIncognitoEnabled(extension->id(), allow); |
| + } |
| + |
| + SetResult(Value::CreateBooleanValue(result)); |
|
asargent_no_longer_on_chrome
2013/02/22 00:04:06
nit: instead of a boolean result passed as an argu
Gaurav
2013/02/25 18:26:51
Done.
|
| + return true; |
| +} |
| + |
| +DeveloperPrivateAllowIncognitoFunction:: |
| + ~DeveloperPrivateAllowIncognitoFunction() {} |
| + |
| + |
| bool DeveloperPrivateReloadFunction::RunImpl() { |
| std::string extension_id; |
| EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &extension_id)); |