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/chrome_notification_types.h" |
8 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 9 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
9 #include "chrome/browser/signin/token_service.h" | 10 #include "chrome/browser/signin/token_service.h" |
10 #include "chrome/common/chrome_notification_types.h" | |
11 #include "content/public/browser/notification_source.h" | 11 #include "content/public/browser/notification_source.h" |
12 | 12 |
13 namespace policy { | 13 namespace policy { |
14 | 14 |
15 UserCloudPolicyTokenForwarder::UserCloudPolicyTokenForwarder( | 15 UserCloudPolicyTokenForwarder::UserCloudPolicyTokenForwarder( |
16 UserCloudPolicyManagerChromeOS* manager, | 16 UserCloudPolicyManagerChromeOS* manager, |
17 TokenService* token_service) | 17 TokenService* token_service) |
18 : manager_(manager), | 18 : manager_(manager), |
19 token_service_(token_service) { | 19 token_service_(token_service) { |
20 if (token_service_->HasOAuthLoginToken()) { | 20 if (token_service_->HasOAuthLoginToken()) { |
(...skipping 18 matching lines...) Expand all Loading... |
39 const content::NotificationDetails& details) { | 39 const content::NotificationDetails& details) { |
40 DCHECK(type == chrome::NOTIFICATION_TOKEN_AVAILABLE); | 40 DCHECK(type == chrome::NOTIFICATION_TOKEN_AVAILABLE); |
41 if (token_service_->HasOAuthLoginToken()) { | 41 if (token_service_->HasOAuthLoginToken()) { |
42 registrar_.RemoveAll(); | 42 registrar_.RemoveAll(); |
43 manager_->OnRefreshTokenAvailable( | 43 manager_->OnRefreshTokenAvailable( |
44 token_service_->GetOAuth2LoginRefreshToken()); | 44 token_service_->GetOAuth2LoginRefreshToken()); |
45 } | 45 } |
46 } | 46 } |
47 | 47 |
48 } // namespace policy | 48 } // namespace policy |
OLD | NEW |