Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3481)

Unified Diff: chrome/browser/extensions/api/module/module.cc

Issue 2327723002: [Extensions] Convert some ChromeSyncExtensionFunctions (Closed)
Patch Set: fix Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/api/module/module.h ('k') | extensions/browser/extension_function.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/module/module.cc
diff --git a/chrome/browser/extensions/api/module/module.cc b/chrome/browser/extensions/api/module/module.cc
index 7bd4f26599a266f898690acd7780199d77206ca7..d98c2a05ad8a0712236b42b19a0dc0fb7d51d009 100644
--- a/chrome/browser/extensions/api/module/module.cc
+++ b/chrome/browser/extensions/api/module/module.cc
@@ -37,29 +37,30 @@ std::string GetUpdateURLData(const ExtensionPrefs* prefs,
} // namespace extension
-bool ExtensionSetUpdateUrlDataFunction::RunSync() {
+ExtensionFunction::ResponseAction ExtensionSetUpdateUrlDataFunction::Run() {
std::string data;
EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &data));
if (ManifestURL::UpdatesFromGallery(extension())) {
- return false;
+ return RespondNow(Error(kUnknownErrorDoNotUse));
}
- ExtensionPrefs::Get(GetProfile())->UpdateExtensionPref(
- extension_id(), extension::kUpdateURLData, new base::StringValue(data));
- return true;
+ ExtensionPrefs::Get(browser_context())
+ ->UpdateExtensionPref(extension_id(), extension::kUpdateURLData,
+ new base::StringValue(data));
+ return RespondNow(NoArguments());
}
-bool ExtensionIsAllowedIncognitoAccessFunction::RunSync() {
- SetResult(base::MakeUnique<base::FundamentalValue>(
- util::IsIncognitoEnabled(extension_id(), GetProfile())));
- return true;
+ExtensionFunction::ResponseAction
+ExtensionIsAllowedIncognitoAccessFunction::Run() {
+ return RespondNow(OneArgument(base::MakeUnique<base::FundamentalValue>(
+ util::IsIncognitoEnabled(extension_id(), browser_context()))));
}
-bool ExtensionIsAllowedFileSchemeAccessFunction::RunSync() {
- SetResult(base::MakeUnique<base::FundamentalValue>(
- util::AllowFileAccess(extension_id(), GetProfile())));
- return true;
+ExtensionFunction::ResponseAction
+ExtensionIsAllowedFileSchemeAccessFunction::Run() {
+ return RespondNow(OneArgument(base::MakeUnique<base::FundamentalValue>(
+ util::AllowFileAccess(extension_id(), browser_context()))));
}
} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/api/module/module.h ('k') | extensions/browser/extension_function.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698