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

Unified Diff: chrome/browser/extensions/api/identity/identity_remove_cached_auth_token_function.cc

Issue 2657223002: Move impl of identity.RemoveCachedAuthToken() extension API to its own file (Closed)
Patch Set: Doh Created 3 years, 11 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/identity/identity_remove_cached_auth_token_function.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/identity/identity_remove_cached_auth_token_function.cc
diff --git a/chrome/browser/extensions/api/identity/identity_remove_cached_auth_token_function.cc b/chrome/browser/extensions/api/identity/identity_remove_cached_auth_token_function.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e9708d0b77e24f5318f224834e7d320abcc9b3e6
--- /dev/null
+++ b/chrome/browser/extensions/api/identity/identity_remove_cached_auth_token_function.cc
@@ -0,0 +1,34 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/api/identity/identity_remove_cached_auth_token_function.h"
+
+#include "chrome/browser/extensions/api/identity/identity_api.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/common/extensions/api/identity.h"
+
+namespace extensions {
+
+namespace identity = api::identity;
+
+IdentityRemoveCachedAuthTokenFunction::IdentityRemoveCachedAuthTokenFunction() {
+}
+
+IdentityRemoveCachedAuthTokenFunction::
+ ~IdentityRemoveCachedAuthTokenFunction() {}
+
+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(browser_context())
+ ->EraseCachedToken(extension()->id(), params->details.token);
+ return RespondNow(NoArguments());
+}
+
+} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/api/identity/identity_remove_cached_auth_token_function.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698