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 5be759cb9690de5cb2f07a181f450998a7ffcc1a..66d6e06b46242135f427b0ec0900ea0850464f1f 100644 |
--- a/chrome/browser/policy/device_token_fetcher.h |
+++ b/chrome/browser/policy/device_token_fetcher.h |
@@ -15,6 +15,8 @@ |
#include "chrome/common/notification_observer.h" |
#include "chrome/common/notification_registrar.h" |
+class Profile; |
+ |
namespace policy { |
namespace em = enterprise_management; |
@@ -69,6 +71,8 @@ class DeviceTokenFetcher |
private: |
friend class DeviceTokenFetcherTest; |
+ friend void SimulateUsernameAvailable(DeviceTokenFetcher* fetcher, |
+ const std::string& username); |
// The different states that the fetcher can be in during the process of |
// getting the device token. |
@@ -100,6 +104,15 @@ class DeviceTokenFetcher |
// request. |
void MakeReadyToRequestDeviceToken(); |
+ // Returns the email address of the currently logged-in user. |
+ std::string GetCurrentUser(); |
+ |
+ // Checks the email of the currently logged-in user against the list of |
+ // non-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|. |
Mattias Nissler (ping if slow)
2010/11/16 09:54:31
I feel the reference to |kNonDasherDomains| here i
gfeher
2010/11/16 17:37:01
Done.
|
+ 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. |
@@ -130,6 +143,15 @@ class DeviceTokenFetcher |
// Registers the fetcher for notification of successful Gaia logins. |
NotificationRegistrar registrar_; |
+ |
+ // Only set when a user is signed in via SigninManager. Only used to |
+ // check later if the user is still logged on. |
+ Profile* profile_; |
+ |
+ // Helper for testing: if this is not NULL, then DeviceTokenFetcher does not |
+ // get the logged-in user's name from UserManager or SigninManager, but |
+ // uses this value instead. |
+ scoped_ptr<std::string> injected_username; |
Mattias Nissler (ping if slow)
2010/11/16 09:54:31
Why scoped_ptr-wrapped?
Also, it seems a bit odd
gfeher
2010/11/16 17:37:01
To allow it to be NULL. Let's forget it. :)
|
}; |
} // namespace policy |