| 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_ARC_SESSION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <ostream> | 9 #include <ostream> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 226 |
| 227 // Returns whether the Play Store app is requested to be launched by this | 227 // Returns whether the Play Store app is requested to be launched by this |
| 228 // class. Should be used only for tests. | 228 // class. Should be used only for tests. |
| 229 bool IsPlaystoreLaunchRequestedForTesting() const; | 229 bool IsPlaystoreLaunchRequestedForTesting() const; |
| 230 | 230 |
| 231 // Invoking StartArc() only for testing, e.g., to emulate accepting Terms of | 231 // Invoking StartArc() only for testing, e.g., to emulate accepting Terms of |
| 232 // Service then passing Android management check successfully. | 232 // Service then passing Android management check successfully. |
| 233 void StartArcForTesting() { StartArc(); } | 233 void StartArcForTesting() { StartArc(); } |
| 234 | 234 |
| 235 private: | 235 private: |
| 236 // Reports statuses of OptIn flow to UMA. |
| 237 class ScopedOptInFlowTracker; |
| 238 |
| 236 // RequestEnable() has a check in order not to trigger starting procedure | 239 // RequestEnable() has a check in order not to trigger starting procedure |
| 237 // twice. This method can be called to bypass that check when restarting. | 240 // twice. This method can be called to bypass that check when restarting. |
| 238 void RequestEnableImpl(); | 241 void RequestEnableImpl(); |
| 239 | 242 |
| 240 // Negotiates the terms of service to user, if necessary. | 243 // Negotiates the terms of service to user, if necessary. |
| 241 // Otherwise, move to StartAndroidManagementCheck(). | 244 // Otherwise, move to StartAndroidManagementCheck(). |
| 242 void MaybeStartTermsOfServiceNegotiation(); | 245 void MaybeStartTermsOfServiceNegotiation(); |
| 243 void OnTermsOfServiceNegotiated(bool accepted); | 246 void OnTermsOfServiceNegotiated(bool accepted); |
| 244 | 247 |
| 245 // Returns true if Terms of Service negotiation is needed. Otherwise false. | 248 // Returns true if Terms of Service negotiation is needed. Otherwise false. |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 319 bool provisioning_reported_ = false; | 322 bool provisioning_reported_ = false; |
| 320 base::OneShotTimer arc_sign_in_timer_; | 323 base::OneShotTimer arc_sign_in_timer_; |
| 321 | 324 |
| 322 std::unique_ptr<ArcSupportHost> support_host_; | 325 std::unique_ptr<ArcSupportHost> support_host_; |
| 323 | 326 |
| 324 std::unique_ptr<ArcTermsOfServiceNegotiator> terms_of_service_negotiator_; | 327 std::unique_ptr<ArcTermsOfServiceNegotiator> terms_of_service_negotiator_; |
| 325 | 328 |
| 326 std::unique_ptr<ArcAuthContext> context_; | 329 std::unique_ptr<ArcAuthContext> context_; |
| 327 std::unique_ptr<ArcAndroidManagementChecker> android_management_checker_; | 330 std::unique_ptr<ArcAndroidManagementChecker> android_management_checker_; |
| 328 | 331 |
| 332 std::unique_ptr<ScopedOptInFlowTracker> scoped_opt_in_tracker_; |
| 333 |
| 329 // The time when the sign in process started. | 334 // The time when the sign in process started. |
| 330 base::Time sign_in_start_time_; | 335 base::Time sign_in_start_time_; |
| 331 // The time when ARC was about to start. | 336 // The time when ARC was about to start. |
| 332 base::Time arc_start_time_; | 337 base::Time arc_start_time_; |
| 333 base::Closure attempt_user_exit_callback_; | 338 base::Closure attempt_user_exit_callback_; |
| 334 | 339 |
| 335 // Must be the last member. | 340 // Must be the last member. |
| 336 base::WeakPtrFactory<ArcSessionManager> weak_ptr_factory_; | 341 base::WeakPtrFactory<ArcSessionManager> weak_ptr_factory_; |
| 337 | 342 |
| 338 DISALLOW_COPY_AND_ASSIGN(ArcSessionManager); | 343 DISALLOW_COPY_AND_ASSIGN(ArcSessionManager); |
| 339 }; | 344 }; |
| 340 | 345 |
| 341 // Outputs the stringified |state| to |os|. This is only for logging purposes. | 346 // Outputs the stringified |state| to |os|. This is only for logging purposes. |
| 342 std::ostream& operator<<(std::ostream& os, | 347 std::ostream& operator<<(std::ostream& os, |
| 343 const ArcSessionManager::State& state); | 348 const ArcSessionManager::State& state); |
| 344 | 349 |
| 345 } // namespace arc | 350 } // namespace arc |
| 346 | 351 |
| 347 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_ | 352 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_SESSION_MANAGER_H_ |
| OLD | NEW |