forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename InvalidationAuthProvider to IdentityProvider
The InvalidationAuthProvider is useful outside the area of invalidation: It provides an abstract interface for accessing the logged-in GAIA account and receiving notifications about login/logout events. This CL renames the InvalidationAuthProvider to IdentityProvider and places it in the gaia_apis component. This change is a prerequisite for CL 225403021, which will use the IdentityProvider in GCM. BUG=362083 TEST=Updated tests TBR=atwilson (for chrome/browser/sync/test/integration/sync_test.cc) Review URL: https://codereview.chromium.org/235273002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265706 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
bartfab@chromium.org
committed
Apr 23, 2014
1 parent
2442605
commit a263ff5
Showing
33 changed files
with
484 additions
and
386 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
chrome/browser/chromeos/settings/device_identity_provider.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright 2014 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 "chrome/browser/chromeos/settings/device_identity_provider.h" | ||
|
||
#include "chrome/browser/chromeos/settings/device_oauth2_token_service.h" | ||
|
||
namespace chromeos { | ||
|
||
DeviceIdentityProvider::DeviceIdentityProvider( | ||
chromeos::DeviceOAuth2TokenService* token_service) | ||
: token_service_(token_service) {} | ||
|
||
DeviceIdentityProvider::~DeviceIdentityProvider() {} | ||
|
||
std::string DeviceIdentityProvider::GetActiveUsername() { | ||
return token_service_->GetRobotAccountId(); | ||
} | ||
|
||
std::string DeviceIdentityProvider::GetActiveAccountId() { | ||
return token_service_->GetRobotAccountId(); | ||
} | ||
|
||
OAuth2TokenService* DeviceIdentityProvider::GetTokenService() { | ||
return token_service_; | ||
} | ||
|
||
bool DeviceIdentityProvider::RequestLogin() { | ||
return false; | ||
} | ||
|
||
} // namespace chromeos |
36 changes: 36 additions & 0 deletions
36
chrome/browser/chromeos/settings/device_identity_provider.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2014 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. | ||
|
||
#ifndef CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_IDENTITY_PROVIDER_H_ | ||
#define CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_IDENTITY_PROVIDER_H_ | ||
|
||
#include "base/macros.h" | ||
#include "google_apis/gaia/identity_provider.h" | ||
|
||
namespace chromeos { | ||
|
||
class DeviceOAuth2TokenService; | ||
|
||
// Identity provider implementation backed by DeviceOAuth2TokenService. | ||
class DeviceIdentityProvider : public IdentityProvider { | ||
public: | ||
explicit DeviceIdentityProvider( | ||
chromeos::DeviceOAuth2TokenService* token_service); | ||
virtual ~DeviceIdentityProvider(); | ||
|
||
// IdentityProvider: | ||
virtual std::string GetActiveUsername() OVERRIDE; | ||
virtual std::string GetActiveAccountId() OVERRIDE; | ||
virtual OAuth2TokenService* GetTokenService() OVERRIDE; | ||
virtual bool RequestLogin() OVERRIDE; | ||
|
||
private: | ||
chromeos::DeviceOAuth2TokenService* token_service_; | ||
|
||
DISALLOW_COPY_AND_ASSIGN(DeviceIdentityProvider); | ||
}; | ||
|
||
} // namespace chromeos | ||
|
||
#endif // CHROME_BROWSER_CHROMEOS_SETTINGS_DEVICE_IDENTITY_PROVIDER_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
chrome/browser/invalidation/device_invalidation_auth_provider_chromeos.cc
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
chrome/browser/invalidation/device_invalidation_auth_provider_chromeos.h
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.