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

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

Issue 2661913002: Identity extension API impl: Split constants into their own file (Closed)
Patch Set: 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
« no previous file with comments | « chrome/browser/extensions/api/identity/identity_launch_web_auth_flow_function.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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_remove_cached_auth_tok en_function.h" 5 #include "chrome/browser/extensions/api/identity/identity_remove_cached_auth_tok en_function.h"
6 6
7 #include "chrome/browser/extensions/api/identity/identity_api.h" 7 #include "chrome/browser/extensions/api/identity/identity_api.h"
8 #include "chrome/browser/extensions/api/identity/identity_constants.h"
8 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/common/extensions/api/identity.h" 10 #include "chrome/common/extensions/api/identity.h"
10 11
11 namespace extensions { 12 namespace extensions {
12 13
13 namespace identity = api::identity; 14 namespace identity = api::identity;
14 15
15 IdentityRemoveCachedAuthTokenFunction::IdentityRemoveCachedAuthTokenFunction() { 16 IdentityRemoveCachedAuthTokenFunction::IdentityRemoveCachedAuthTokenFunction() {
16 } 17 }
17 18
18 IdentityRemoveCachedAuthTokenFunction:: 19 IdentityRemoveCachedAuthTokenFunction::
19 ~IdentityRemoveCachedAuthTokenFunction() {} 20 ~IdentityRemoveCachedAuthTokenFunction() {}
20 21
21 ExtensionFunction::ResponseAction IdentityRemoveCachedAuthTokenFunction::Run() { 22 ExtensionFunction::ResponseAction IdentityRemoveCachedAuthTokenFunction::Run() {
22 if (Profile::FromBrowserContext(browser_context())->IsOffTheRecord()) 23 if (Profile::FromBrowserContext(browser_context())->IsOffTheRecord())
23 return RespondNow(Error(identity_constants::kOffTheRecord)); 24 return RespondNow(Error(identity_constants::kOffTheRecord));
24 25
25 std::unique_ptr<identity::RemoveCachedAuthToken::Params> params( 26 std::unique_ptr<identity::RemoveCachedAuthToken::Params> params(
26 identity::RemoveCachedAuthToken::Params::Create(*args_)); 27 identity::RemoveCachedAuthToken::Params::Create(*args_));
27 EXTENSION_FUNCTION_VALIDATE(params.get()); 28 EXTENSION_FUNCTION_VALIDATE(params.get());
28 IdentityAPI::GetFactoryInstance() 29 IdentityAPI::GetFactoryInstance()
29 ->Get(browser_context()) 30 ->Get(browser_context())
30 ->EraseCachedToken(extension()->id(), params->details.token); 31 ->EraseCachedToken(extension()->id(), params->details.token);
31 return RespondNow(NoArguments()); 32 return RespondNow(NoArguments());
32 } 33 }
33 34
34 } // namespace extensions 35 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/identity/identity_launch_web_auth_flow_function.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698