1 // Copyright 2014 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. 4 5 #ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_IDENTITY_PROVIDER_H_ 6 #define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_IDENTITY_PROVIDER_H_ 7 8 #include "base/macros.h" 9 #include "google_apis/gaia/identity_provider.h" 10 11 namespace chromeos { 12 13 class DeviceOAuth2TokenService; 14 15 // Identity provider implementation backed by DeviceOAuth2TokenService. 16 class DeviceIdentityProvider : public IdentityProvider { 17 public: 18 explicit DeviceIdentityProvider( 19 chromeos::DeviceOAuth2TokenService* token_service); 20 virtual ~DeviceIdentityProvider(); 21 22 // IdentityProvider: 23 virtual std::string GetActiveUsername() OVERRIDE; 24 virtual std::string GetActiveAccountId() OVERRIDE; 25 virtual OAuth2TokenService* GetTokenService() OVERRIDE; 26 virtual bool RequestLogin() OVERRIDE; 27 28 private: 29 chromeos::DeviceOAuth2TokenService* token_service_; 30 31 DISALLOW_COPY_AND_ASSIGN(DeviceIdentityProvider); 32 }; 33 34 } // namespace chromeos 35 36 #endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_IDENTITY_PROVIDER_H_ 37