| Index: chrome/browser/policy/device_token_fetcher.h
|
| diff --git a/chrome/browser/policy/device_token_fetcher.h b/chrome/browser/policy/device_token_fetcher.h
|
| index 7704d35cdc0c4391fbba84be422896a6ed321de8..cc1ce2cd43fcc1f5bc6fe8da013432cdca9c1ea4 100644
|
| --- a/chrome/browser/policy/device_token_fetcher.h
|
| +++ b/chrome/browser/policy/device_token_fetcher.h
|
| @@ -16,6 +16,7 @@
|
| #include "chrome/common/notification_registrar.h"
|
|
|
| class TokenService;
|
| +class Profile;
|
|
|
| namespace policy {
|
|
|
| @@ -35,7 +36,7 @@ class DeviceTokenFetcher
|
| // obtains the authentication token from |token_service|. The fetcher stores
|
| // the device token to |token_path| once it's retrieved from the server.
|
| DeviceTokenFetcher(DeviceManagementBackend* backend,
|
| - TokenService* token_service,
|
| + Profile* profile,
|
| const FilePath& token_path);
|
| virtual ~DeviceTokenFetcher() {}
|
|
|
| @@ -76,6 +77,14 @@ class DeviceTokenFetcher
|
| // True if the device token has been fetched and is valid.
|
| bool IsTokenValid() const;
|
|
|
| + protected:
|
| + // Returns the email address of the currently logged-in user.
|
| + virtual std::string GetCurrentUser();
|
| +
|
| + // Used to identify GOOGLE_SIGNIN_SUCCESSFUL notifications from the owning
|
| + // profile, and to query for the current username.
|
| + Profile* profile_; // weak
|
| +
|
| private:
|
| friend class DeviceTokenFetcherTest;
|
|
|
| @@ -109,6 +118,12 @@ class DeviceTokenFetcher
|
| // request.
|
| void MakeReadyToRequestDeviceToken();
|
|
|
| + // Checks the email of the currently logged-in user against the list of known
|
| + // non-dasher domain names. Returns false if there is no user logged in, or
|
| + // if the domain part of the email of the currently logged in user is in
|
| + // |kNonDasherDomains|.
|
| + bool CanCurrentUserBeDasher();
|
| +
|
| // Issues a registration request to the server if both the fetcher is in the
|
| // ready-to-request state and the device management server AuthToken is
|
| // available.
|
|
|