15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Copyright (c) 2012 The Chromium Authors. All rights reserved.
25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// found in the LICENSE file.
45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)#include "google_apis/gaia/oauth2_access_token_fetcher.h"
65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)OAuth2AccessTokenFetcher::OAuth2AccessTokenFetcher(
8a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)    OAuth2AccessTokenConsumer* consumer)
9a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)    : consumer_(consumer) {}
105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
11a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)OAuth2AccessTokenFetcher::~OAuth2AccessTokenFetcher() {}
125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
13a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)void OAuth2AccessTokenFetcher::FireOnGetTokenSuccess(
145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    const std::string& access_token,
155821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    const base::Time& expiration_time) {
165821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  consumer_->OnGetTokenSuccess(access_token, expiration_time);
175821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
185821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)
19a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)void OAuth2AccessTokenFetcher::FireOnGetTokenFailure(
205821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)    const GoogleServiceAuthError& error) {
215821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)  consumer_->OnGetTokenFailure(error);
225821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)}
23