| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.h" | 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_token_forwarder.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 8 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
| 9 #include "chrome/browser/signin/token_service.h" | 9 #include "chrome/browser/signin/token_service.h" |
| 10 #include "chrome/common/chrome_notification_types.h" | 10 #include "chrome/common/chrome_notification_types.h" |
| 11 #include "content/public/browser/notification_source.h" |
| 11 | 12 |
| 12 namespace policy { | 13 namespace policy { |
| 13 | 14 |
| 14 UserCloudPolicyTokenForwarder::UserCloudPolicyTokenForwarder( | 15 UserCloudPolicyTokenForwarder::UserCloudPolicyTokenForwarder( |
| 15 UserCloudPolicyManagerChromeOS* manager, | 16 UserCloudPolicyManagerChromeOS* manager, |
| 16 TokenService* token_service) | 17 TokenService* token_service) |
| 17 : manager_(manager), | 18 : manager_(manager), |
| 18 token_service_(token_service) { | 19 token_service_(token_service) { |
| 19 if (token_service_->HasOAuthLoginToken()) { | 20 if (token_service_->HasOAuthLoginToken()) { |
| 20 manager_->OnRefreshTokenAvailable( | 21 manager_->OnRefreshTokenAvailable( |
| (...skipping 17 matching lines...) Expand all Loading... |
| 38 const content::NotificationDetails& details) { | 39 const content::NotificationDetails& details) { |
| 39 DCHECK(type == chrome::NOTIFICATION_TOKEN_AVAILABLE); | 40 DCHECK(type == chrome::NOTIFICATION_TOKEN_AVAILABLE); |
| 40 if (token_service_->HasOAuthLoginToken()) { | 41 if (token_service_->HasOAuthLoginToken()) { |
| 41 registrar_.RemoveAll(); | 42 registrar_.RemoveAll(); |
| 42 manager_->OnRefreshTokenAvailable( | 43 manager_->OnRefreshTokenAvailable( |
| 43 token_service_->GetOAuth2LoginRefreshToken()); | 44 token_service_->GetOAuth2LoginRefreshToken()); |
| 44 } | 45 } |
| 45 } | 46 } |
| 46 | 47 |
| 47 } // namespace policy | 48 } // namespace policy |
| OLD | NEW |