blob: 65d32e85ab119b0db2b345a2d94476fa65f439c4 [file] [log] [blame]
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <string>
class GoogleServiceAuthError;
namespace base {
class Time;
// An interface that defines the callbacks for consumers to which
// OAuth2AccessTokenFetcher can return results.
class OAuth2AccessTokenConsumer {
// Success callback. |access_token| will contain a valid OAuth2 access token.
// |expiration_time| is the date until which the token can be used. This
// value has a built-in safety margin, so it can be used as-is.
virtual void OnGetTokenSuccess(const std::string& access_token,
const base::Time& expiration_time) {}
virtual void OnGetTokenFailure(const GoogleServiceAuthError& error) {}
virtual ~OAuth2AccessTokenConsumer() {}