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
3 // found in the LICENSE file.
5 #include "content/shell/geolocation/shell_access_token_store.h"
8 #include "base/message_loop.h"
9 #include "base/utf_string_conversions.h"
11 ShellAccessTokenStore::ShellAccessTokenStore(
12 net::URLRequestContextGetter
* request_context
)
13 : request_context_(request_context
) {
16 ShellAccessTokenStore::~ShellAccessTokenStore() {
19 void ShellAccessTokenStore::LoadAccessTokens(
20 const LoadAccessTokensCallbackType
& callback
) {
21 MessageLoop::current()->PostTask(
23 base::Bind(&ShellAccessTokenStore::DidLoadAccessTokens
,
24 request_context_
, callback
));
27 void ShellAccessTokenStore::DidLoadAccessTokens(
28 net::URLRequestContextGetter
* request_context
,
29 const LoadAccessTokensCallbackType
& callback
) {
30 // Since content_shell is a test executable, rather than an end user program,
31 // we provide a dummy access_token set to avoid hitting the server.
32 AccessTokenSet access_token_set
;
33 access_token_set
[GURL()] = ASCIIToUTF16("chromium_content_shell");
34 callback
.Run(access_token_set
, request_context
);
37 void ShellAccessTokenStore::SaveAccessToken(
38 const GURL
& server_url
, const string16
& access_token
) {