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

Unified Diff: chrome/browser/extensions/api/omnibox/omnibox_api.cc

Issue 2344653002: [Extensions] Convert some ChromeSyncExtensionFunctions (Closed)
Patch Set: 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/omnibox/omnibox_api.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/omnibox/omnibox_api.cc
diff --git a/chrome/browser/extensions/api/omnibox/omnibox_api.cc b/chrome/browser/extensions/api/omnibox/omnibox_api.cc
index cfcb119a49b25e61c2a69b6312740e6319fd4278..835e6619af36aef5e8b8834ae2d6f13273b39b17 100644
--- a/chrome/browser/extensions/api/omnibox/omnibox_api.cc
+++ b/chrome/browser/extensions/api/omnibox/omnibox_api.cc
@@ -284,33 +284,35 @@ void BrowserContextKeyedAPIFactory<OmniboxAPI>::DeclareFactoryDependencies() {
DependsOn(TemplateURLServiceFactory::GetInstance());
}
-bool OmniboxSendSuggestionsFunction::RunSync() {
+ExtensionFunction::ResponseAction OmniboxSendSuggestionsFunction::Run() {
std::unique_ptr<SendSuggestions::Params> params(
SendSuggestions::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
content::NotificationService::current()->Notify(
extensions::NOTIFICATION_EXTENSION_OMNIBOX_SUGGESTIONS_READY,
- content::Source<Profile>(GetProfile()->GetOriginalProfile()),
+ content::Source<Profile>(
+ Profile::FromBrowserContext(browser_context())->GetOriginalProfile()),
content::Details<SendSuggestions::Params>(params.get()));
- return true;
+ return RespondNow(NoArguments());
}
-bool OmniboxSetDefaultSuggestionFunction::RunSync() {
+ExtensionFunction::ResponseAction OmniboxSetDefaultSuggestionFunction::Run() {
std::unique_ptr<SetDefaultSuggestion::Params> params(
SetDefaultSuggestion::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params);
- if (SetOmniboxDefaultSuggestion(
- GetProfile(), extension_id(), params->suggestion)) {
+ Profile* profile = Profile::FromBrowserContext(browser_context());
+ if (SetOmniboxDefaultSuggestion(profile, extension_id(),
+ params->suggestion)) {
content::NotificationService::current()->Notify(
extensions::NOTIFICATION_EXTENSION_OMNIBOX_DEFAULT_SUGGESTION_CHANGED,
- content::Source<Profile>(GetProfile()->GetOriginalProfile()),
+ content::Source<Profile>(profile->GetOriginalProfile()),
content::NotificationService::NoDetails());
}
- return true;
+ return RespondNow(NoArguments());
}
// This function converts style information populated by the JSON schema
« no previous file with comments | « chrome/browser/extensions/api/omnibox/omnibox_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698