Index: chrome/browser/policy/user_policy_identity_strategy.cc |
diff --git a/chrome/browser/policy/user_policy_identity_strategy.cc b/chrome/browser/policy/user_policy_identity_strategy.cc |
index f6f329a87598bac3dec9419854f1549d8545f6ca..12a1289b6829a43fceba34f124b3a32b51e0bf63 100644 |
--- a/chrome/browser/policy/user_policy_identity_strategy.cc |
+++ b/chrome/browser/policy/user_policy_identity_strategy.cc |
@@ -8,6 +8,8 @@ |
#include "chrome/browser/browser_signin.h" |
#include "chrome/browser/browser_thread.h" |
#include "chrome/browser/net/gaia/token_service.h" |
+#include "chrome/browser/policy/proto/device_management_backend.pb.h" |
+#include "chrome/browser/policy/proto/device_management_constants.h" |
#include "chrome/browser/policy/proto/device_management_local.pb.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/common/guid.h" |
@@ -163,6 +165,20 @@ std::string UserPolicyIdentityStrategy::GetDeviceID() { |
return device_id_; |
} |
+std::string UserPolicyIdentityStrategy::GetMachineID() { |
+ return ""; |
+} |
+ |
+em::DeviceRegisterRequest_Type |
+UserPolicyIdentityStrategy::GetPolicyRegisterType() { |
+ return em::DeviceRegisterRequest::USER; |
+} |
+ |
+std::string UserPolicyIdentityStrategy::GetPolicyType() { |
+ return kChromeUserPolicyType; |
+} |
+ |
+ |
bool UserPolicyIdentityStrategy::GetCredentials(std::string* username, |
std::string* auth_token) { |
*username = GetCurrentUser(); |
@@ -221,7 +237,11 @@ void UserPolicyIdentityStrategy::Observe(NotificationType type, |
const TokenService::TokenAvailableDetails* token_details = |
Details<const TokenService::TokenAvailableDetails>(details).ptr(); |
if (token_details->service() == GaiaConstants::kDeviceManagementService) |
- CheckAndTriggerFetch(); |
+ if (device_token_.empty()) { |
+ // Request a new device management server token, but only in case we |
+ // don't already have it. |
+ CheckAndTriggerFetch(); |
+ } |
} |
#if defined(OS_CHROMEOS) |
} else if (type == NotificationType::LOGIN_USER_CHANGED) { |