Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Unified Diff: chrome/browser/chromeos/settings/device_oauth2_token_service.h

Issue 25975002: cryptohome: Move Encrypt/DecryptWithSystemSalt() out of CryptohomeLibrary (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/settings/device_oauth2_token_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/settings/device_oauth2_token_service.h
diff --git a/chrome/browser/chromeos/settings/device_oauth2_token_service.h b/chrome/browser/chromeos/settings/device_oauth2_token_service.h
index 08d47d5c74167f7e25817fc678ff6e4c4e4f10e9..447c6dfbb7f996853617d295be05b618ef3d9875 100644
--- a/chrome/browser/chromeos/settings/device_oauth2_token_service.h
+++ b/chrome/browser/chromeos/settings/device_oauth2_token_service.h
@@ -28,6 +28,8 @@ class Profile;
namespace chromeos {
+class TokenEncryptor;
+
// DeviceOAuth2TokenService retrieves OAuth2 access tokens for a given
// set of scopes using the device-level OAuth2 any-api refresh token
// obtained during enterprise device enrollment.
@@ -67,8 +69,10 @@ class DeviceOAuth2TokenService : public OAuth2TokenService {
friend class TestDeviceOAuth2TokenService;
// Use DeviceOAuth2TokenServiceFactory to get an instance of this class.
+ // Ownership of |token_encryptor| will be taken.
explicit DeviceOAuth2TokenService(net::URLRequestContextGetter* getter,
- PrefService* local_state);
+ PrefService* local_state,
+ TokenEncryptor* token_encryptor);
virtual ~DeviceOAuth2TokenService();
void OnValidationComplete(bool token_is_valid);
@@ -81,6 +85,10 @@ class DeviceOAuth2TokenService : public OAuth2TokenService {
// Cache the decrypted refresh token, so we only decrypt once.
std::string refresh_token_;
PrefService* local_state_;
+
+ // Used to encrypt/decrypt the refresh token.
+ scoped_ptr<TokenEncryptor> token_encryptor_;
+
DISALLOW_COPY_AND_ASSIGN(DeviceOAuth2TokenService);
};
« no previous file with comments | « no previous file | chrome/browser/chromeos/settings/device_oauth2_token_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698