| 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_AUTH_CONTEXT_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_CONTEXT_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_CONTEXT_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_CONTEXT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 void OnRefreshTokensLoaded() override; | 53 void OnRefreshTokensLoaded() override; |
| 54 | 54 |
| 55 // UbertokenConsumer: | 55 // UbertokenConsumer: |
| 56 void OnUbertokenSuccess(const std::string& token) override; | 56 void OnUbertokenSuccess(const std::string& token) override; |
| 57 void OnUbertokenFailure(const GoogleServiceAuthError& error) override; | 57 void OnUbertokenFailure(const GoogleServiceAuthError& error) override; |
| 58 | 58 |
| 59 // GaiaAuthConsumer: | 59 // GaiaAuthConsumer: |
| 60 void OnMergeSessionSuccess(const std::string& data) override; | 60 void OnMergeSessionSuccess(const std::string& data) override; |
| 61 void OnMergeSessionFailure(const GoogleServiceAuthError& error) override; | 61 void OnMergeSessionFailure(const GoogleServiceAuthError& error) override; |
| 62 | 62 |
| 63 // Skips the merge session, instead calling the callback passed to |Prepare()| |
| 64 // once the refresh token is available. Use only in testing. |
| 65 void SkipMergeSessionForTesting() { skip_merge_session_for_testing_ = true; } |
| 66 |
| 63 private: | 67 private: |
| 64 void OnRefreshTokenTimeout(); | 68 void OnRefreshTokenTimeout(); |
| 65 | 69 |
| 66 void StartFetchers(); | 70 void StartFetchers(); |
| 67 void ResetFetchers(); | 71 void ResetFetchers(); |
| 68 | 72 |
| 69 // Unowned pointer. | 73 // Unowned pointer. |
| 70 ProfileOAuth2TokenService* token_service_; | 74 ProfileOAuth2TokenService* token_service_; |
| 71 std::string account_id_; | 75 std::string account_id_; |
| 72 std::string full_account_id_; | 76 std::string full_account_id_; |
| 73 | 77 |
| 78 // Whether the merge session should be skipped. Set to true only in testing. |
| 79 bool skip_merge_session_for_testing_ = false; |
| 80 |
| 74 // Owned by content::BrowserContent. Used to isolate cookies for auth server | 81 // Owned by content::BrowserContent. Used to isolate cookies for auth server |
| 75 // communication and shared with ARC OptIn UI platform app. | 82 // communication and shared with ARC OptIn UI platform app. |
| 76 content::StoragePartition* storage_partition_ = nullptr; | 83 content::StoragePartition* storage_partition_ = nullptr; |
| 77 | 84 |
| 78 PrepareCallback callback_; | 85 PrepareCallback callback_; |
| 79 bool context_prepared_ = false; | 86 bool context_prepared_ = false; |
| 80 | 87 |
| 81 base::OneShotTimer refresh_token_timeout_; | 88 base::OneShotTimer refresh_token_timeout_; |
| 82 std::unique_ptr<GaiaAuthFetcher> merger_fetcher_; | 89 std::unique_ptr<GaiaAuthFetcher> merger_fetcher_; |
| 83 std::unique_ptr<UbertokenFetcher> ubertoken_fetcher_; | 90 std::unique_ptr<UbertokenFetcher> ubertoken_fetcher_; |
| 84 | 91 |
| 85 DISALLOW_COPY_AND_ASSIGN(ArcAuthContext); | 92 DISALLOW_COPY_AND_ASSIGN(ArcAuthContext); |
| 86 }; | 93 }; |
| 87 | 94 |
| 88 } // namespace arc | 95 } // namespace arc |
| 89 | 96 |
| 90 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_CONTEXT_H_ | 97 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_CONTEXT_H_ |
| OLD | NEW |