Refactor management of overview window copy lifetime into a separate class.
[chromium-blink-merge.git] / content / shell / geolocation / shell_access_token_store.cc
blobceae3d60f6e688f3c2a21f16ce1b193e91d09f23
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"
7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h"
9 #include "base/strings/utf_string_conversions.h"
10 #include "content/public/browser/browser_thread.h"
11 #include "content/shell/browser/shell_browser_context.h"
13 namespace content {
15 ShellAccessTokenStore::ShellAccessTokenStore(
16 content::ShellBrowserContext* shell_browser_context)
17 : shell_browser_context_(shell_browser_context),
18 system_request_context_(NULL) {
21 ShellAccessTokenStore::~ShellAccessTokenStore() {
24 void ShellAccessTokenStore::LoadAccessTokens(
25 const LoadAccessTokensCallbackType& callback) {
26 BrowserThread::PostTaskAndReply(
27 BrowserThread::UI,
28 FROM_HERE,
29 base::Bind(&ShellAccessTokenStore::GetRequestContextOnUIThread,
30 this,
31 shell_browser_context_),
32 base::Bind(&ShellAccessTokenStore::RespondOnOriginatingThread,
33 this,
34 callback));
37 void ShellAccessTokenStore::GetRequestContextOnUIThread(
38 content::ShellBrowserContext* shell_browser_context) {
39 system_request_context_ = shell_browser_context->GetRequestContext();
42 void ShellAccessTokenStore::RespondOnOriginatingThread(
43 const LoadAccessTokensCallbackType& callback) {
44 // Since content_shell is a test executable, rather than an end user program,
45 // we provide a dummy access_token set to avoid hitting the server.
46 AccessTokenSet access_token_set;
47 access_token_set[GURL()] = ASCIIToUTF16("chromium_content_shell");
48 callback.Run(access_token_set, system_request_context_);
51 void ShellAccessTokenStore::SaveAccessToken(
52 const GURL& server_url, const string16& access_token) {
55 } // namespace content