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

Side by Side Diff: chrome/browser/extensions/api/identity/identity_api.cc

Issue 2657223002: Move impl of identity.RemoveCachedAuthToken() extension API to its own file (Closed)
Patch Set: Doh Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/api/identity/identity_api.h" 5 #include "chrome/browser/extensions/api/identity/identity_api.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
912 api::identity::ProfileUserInfo profile_user_info; 912 api::identity::ProfileUserInfo profile_user_info;
913 if (extension()->permissions_data()->HasAPIPermission( 913 if (extension()->permissions_data()->HasAPIPermission(
914 APIPermission::kIdentityEmail)) { 914 APIPermission::kIdentityEmail)) {
915 profile_user_info.email = account.email; 915 profile_user_info.email = account.email;
916 profile_user_info.id = account.gaia; 916 profile_user_info.id = account.gaia;
917 } 917 }
918 918
919 return RespondNow(OneArgument(profile_user_info.ToValue())); 919 return RespondNow(OneArgument(profile_user_info.ToValue()));
920 } 920 }
921 921
922 IdentityRemoveCachedAuthTokenFunction::IdentityRemoveCachedAuthTokenFunction() {
923 }
924
925 IdentityRemoveCachedAuthTokenFunction::
926 ~IdentityRemoveCachedAuthTokenFunction() {
927 }
928
929 ExtensionFunction::ResponseAction IdentityRemoveCachedAuthTokenFunction::Run() {
930 if (Profile::FromBrowserContext(browser_context())->IsOffTheRecord())
931 return RespondNow(Error(identity_constants::kOffTheRecord));
932
933 std::unique_ptr<identity::RemoveCachedAuthToken::Params> params(
934 identity::RemoveCachedAuthToken::Params::Create(*args_));
935 EXTENSION_FUNCTION_VALIDATE(params.get());
936 IdentityAPI::GetFactoryInstance()
937 ->Get(browser_context())
938 ->EraseCachedToken(extension()->id(), params->details.token);
939 return RespondNow(NoArguments());
940 }
941
942 } // namespace extensions 922 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/identity/identity_api.h ('k') | chrome/browser/extensions/api/identity/identity_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698