| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #ifndef CHROME_BROWSER_CHROMEOS_ARC_POLICY_ARC_ANDROID_MANAGEMENT_CHECKER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_POLICY_ARC_ANDROID_MANAGEMENT_CHECKER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_ARC_POLICY_ARC_ANDROID_MANAGEMENT_CHECKER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ARC_POLICY_ARC_ANDROID_MANAGEMENT_CHECKER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "base/time/time.h" |
| 12 #include "chrome/browser/chromeos/policy/android_management_client.h" | 13 #include "chrome/browser/chromeos/policy/android_management_client.h" |
| 13 #include "google_apis/gaia/oauth2_token_service.h" | 14 #include "google_apis/gaia/oauth2_token_service.h" |
| 14 | 15 |
| 15 class ProfileOAuth2TokenService; | 16 class ProfileOAuth2TokenService; |
| 16 | 17 |
| 17 namespace arc { | 18 namespace arc { |
| 18 | 19 |
| 19 class ArcAndroidManagementCheckerDelegate; | 20 class ArcAndroidManagementCheckerDelegate; |
| 20 | 21 |
| 21 class ArcAndroidManagementChecker : public OAuth2TokenService::Observer { | 22 class ArcAndroidManagementChecker : public OAuth2TokenService::Observer { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 44 // Unowned pointers. | 45 // Unowned pointers. |
| 45 ArcAndroidManagementCheckerDelegate* const delegate_; | 46 ArcAndroidManagementCheckerDelegate* const delegate_; |
| 46 ProfileOAuth2TokenService* const token_service_; | 47 ProfileOAuth2TokenService* const token_service_; |
| 47 | 48 |
| 48 const std::string account_id_; | 49 const std::string account_id_; |
| 49 | 50 |
| 50 // In background mode errors are ignored and retry is attempted. There is no | 51 // In background mode errors are ignored and retry is attempted. There is no |
| 51 // retry in foreground mode and result is passed to delegate directly. | 52 // retry in foreground mode and result is passed to delegate directly. |
| 52 bool background_mode_; | 53 bool background_mode_; |
| 53 | 54 |
| 54 // Keeps current retry time for background mode. | 55 // Keeps current retry delay. |
| 55 int retry_time_ms_; | 56 base::TimeDelta retry_delay_; |
| 56 | 57 |
| 57 policy::AndroidManagementClient android_management_client_; | 58 policy::AndroidManagementClient android_management_client_; |
| 58 | 59 |
| 59 base::WeakPtrFactory<ArcAndroidManagementChecker> weak_ptr_factory_; | 60 base::WeakPtrFactory<ArcAndroidManagementChecker> weak_ptr_factory_; |
| 60 | 61 |
| 61 DISALLOW_COPY_AND_ASSIGN(ArcAndroidManagementChecker); | 62 DISALLOW_COPY_AND_ASSIGN(ArcAndroidManagementChecker); |
| 62 }; | 63 }; |
| 63 | 64 |
| 64 } // namespace arc | 65 } // namespace arc |
| 65 | 66 |
| 66 #endif // CHROME_BROWSER_CHROMEOS_ARC_POLICY_ARC_ANDROID_MANAGEMENT_CHECKER_H_ | 67 #endif // CHROME_BROWSER_CHROMEOS_ARC_POLICY_ARC_ANDROID_MANAGEMENT_CHECKER_H_ |
| OLD | NEW |