| 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 2f1847f4350e972aa39d580d66148181b6c9b085..f375710cf5726172d1360877895f1b9aaa75ccf9 100644
|
| --- a/chrome/browser/extensions/api/developer_private/developer_private_api.cc
|
| +++ b/chrome/browser/extensions/api/developer_private/developer_private_api.cc
|
| @@ -607,51 +607,54 @@ DeveloperPrivateUpdateProfileConfigurationFunction::Run() {
|
| }
|
|
|
| DeveloperPrivateUpdateExtensionConfigurationFunction::
|
| -~DeveloperPrivateUpdateExtensionConfigurationFunction() {}
|
| + DeveloperPrivateUpdateExtensionConfigurationFunction(
|
| + const mojo::Callback<void()>& callback)
|
| + : MojoExtensionFunction(callback) {}
|
|
|
| -ExtensionFunction::ResponseAction
|
| -DeveloperPrivateUpdateExtensionConfigurationFunction::Run() {
|
| - std::unique_ptr<developer::UpdateExtensionConfiguration::Params> params(
|
| - developer::UpdateExtensionConfiguration::Params::Create(*args_));
|
| - EXTENSION_FUNCTION_VALIDATE(params);
|
| -
|
| - const developer::ExtensionConfigurationUpdate& update = params->update;
|
| -
|
| - const Extension* extension = GetExtensionById(update.extension_id);
|
| +DeveloperPrivateUpdateExtensionConfigurationFunction::
|
| + ~DeveloperPrivateUpdateExtensionConfigurationFunction() {}
|
| +
|
| +MojoExtensionFunctionBase::RunResult
|
| +DeveloperPrivateUpdateExtensionConfigurationFunction::Run(
|
| + mojom::UpdateExtensionConfigurationParamsPtr update) {
|
| + const Extension* extension = ExtensionRegistry::Get(browser_context())
|
| + ->enabled_extensions()
|
| + .GetByID(update->extension_id);
|
| if (!extension)
|
| - return RespondNow(Error(kNoSuchExtensionError));
|
| + return Error(kNoSuchExtensionError);
|
| if (!user_gesture())
|
| - return RespondNow(Error(kRequiresUserGestureError));
|
| + return Error(kRequiresUserGestureError);
|
|
|
| - if (update.file_access) {
|
| + if (update->has_file_access) {
|
| std::string error;
|
| if (!UserCanModifyExtensionConfiguration(extension,
|
| browser_context(),
|
| &error)) {
|
| - return RespondNow(Error(error));
|
| + return Error(error);
|
| }
|
| - util::SetAllowFileAccess(
|
| - extension->id(), browser_context(), *update.file_access);
|
| + util::SetAllowFileAccess(extension->id(), browser_context(),
|
| + update->file_access);
|
| }
|
| - if (update.incognito_access) {
|
| - util::SetIsIncognitoEnabled(
|
| - extension->id(), browser_context(), *update.incognito_access);
|
| + if (update->has_incognito_access) {
|
| + util::SetIsIncognitoEnabled(extension->id(), browser_context(),
|
| + update->incognito_access);
|
| }
|
| - if (update.error_collection) {
|
| - ErrorConsole::Get(browser_context())->SetReportingAllForExtension(
|
| - extension->id(), *update.error_collection);
|
| + if (update->has_error_collection) {
|
| + ErrorConsole::Get(browser_context())
|
| + ->SetReportingAllForExtension(extension->id(),
|
| + update->error_collection);
|
| }
|
| - if (update.run_on_all_urls) {
|
| - util::SetAllowedScriptingOnAllUrls(
|
| - extension->id(), browser_context(), *update.run_on_all_urls);
|
| + if (update->has_run_on_all_urls) {
|
| + util::SetAllowedScriptingOnAllUrls(extension->id(), browser_context(),
|
| + update->run_on_all_urls);
|
| }
|
| - if (update.show_action_button) {
|
| - ExtensionActionAPI::Get(browser_context())->SetBrowserActionVisibility(
|
| - extension->id(),
|
| - *update.show_action_button);
|
| + if (update->has_show_action_button) {
|
| + ExtensionActionAPI::Get(browser_context())
|
| + ->SetBrowserActionVisibility(extension->id(),
|
| + update->show_action_button);
|
| }
|
|
|
| - return RespondNow(NoArguments());
|
| + return Respond();
|
| }
|
|
|
| DeveloperPrivateReloadFunction::~DeveloperPrivateReloadFunction() {}
|
|
|