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

Unified Diff: chrome/browser/extensions/api/identity/identity_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
Index: chrome/browser/extensions/api/identity/identity_api.cc
diff --git a/chrome/browser/extensions/api/identity/identity_api.cc b/chrome/browser/extensions/api/identity/identity_api.cc
index b6bce398f0101227e6079f383a4d0687a653f7d9..e4c15c1f896fc14cbf2f5fb097a544ce7c5850c5 100644
--- a/chrome/browser/extensions/api/identity/identity_api.cc
+++ b/chrome/browser/extensions/api/identity/identity_api.cc
@@ -928,18 +928,17 @@ IdentityRemoveCachedAuthTokenFunction::
~IdentityRemoveCachedAuthTokenFunction() {
}
-bool IdentityRemoveCachedAuthTokenFunction::RunSync() {
- if (GetProfile()->IsOffTheRecord()) {
- error_ = identity_constants::kOffTheRecord;
- return false;
- }
+ExtensionFunction::ResponseAction IdentityRemoveCachedAuthTokenFunction::Run() {
+ if (Profile::FromBrowserContext(browser_context())->IsOffTheRecord())
+ return RespondNow(Error(identity_constants::kOffTheRecord));
std::unique_ptr<identity::RemoveCachedAuthToken::Params> params(
identity::RemoveCachedAuthToken::Params::Create(*args_));
EXTENSION_FUNCTION_VALIDATE(params.get());
- IdentityAPI::GetFactoryInstance()->Get(GetProfile())->EraseCachedToken(
- extension()->id(), params->details.token);
- return true;
+ IdentityAPI::GetFactoryInstance()
+ ->Get(browser_context())
+ ->EraseCachedToken(extension()->id(), params->details.token);
+ return RespondNow(NoArguments());
}
IdentityLaunchWebAuthFlowFunction::IdentityLaunchWebAuthFlowFunction() {}
« no previous file with comments | « chrome/browser/extensions/api/identity/identity_api.h ('k') | chrome/browser/extensions/api/omnibox/omnibox_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698