Chromium Code Reviews| 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_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ |
| 7 | 7 |
| 8 #include <ostream> | 8 #include <ostream> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace net { | 29 namespace net { |
| 30 class URLRequestContextGetter; | 30 class URLRequestContextGetter; |
| 31 } | 31 } |
| 32 | 32 |
| 33 namespace user_prefs { | 33 namespace user_prefs { |
| 34 class PrefRegistrySyncable; | 34 class PrefRegistrySyncable; |
| 35 } | 35 } |
| 36 | 36 |
| 37 namespace policy { | |
| 38 class AndroidManagementClient; | |
| 39 } | |
| 40 | |
| 37 namespace arc { | 41 namespace arc { |
| 38 | 42 |
| 39 // This class proxies the request from the client to fetch an auth code from | 43 // This class proxies the request from the client to fetch an auth code from |
| 40 // LSO. | 44 // LSO. |
| 41 class ArcAuthService : public ArcService, | 45 class ArcAuthService : public ArcService, |
| 42 public mojom::AuthHost, | 46 public mojom::AuthHost, |
| 43 public ArcBridgeService::Observer, | 47 public ArcBridgeService::Observer, |
| 44 public UbertokenConsumer, | 48 public UbertokenConsumer, |
| 45 public GaiaAuthConsumer, | 49 public GaiaAuthConsumer, |
| 46 public syncable_prefs::PrefServiceSyncableObserver, | 50 public syncable_prefs::PrefServiceSyncableObserver, |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 152 void ShowUI(UIPage page, const base::string16& status); | 156 void ShowUI(UIPage page, const base::string16& status); |
| 153 void CloseUI(); | 157 void CloseUI(); |
| 154 void SetUIPage(UIPage page, const base::string16& status); | 158 void SetUIPage(UIPage page, const base::string16& status); |
| 155 void SetState(State state); | 159 void SetState(State state); |
| 156 void ShutdownBridge(); | 160 void ShutdownBridge(); |
| 157 void ShutdownBridgeAndCloseUI(); | 161 void ShutdownBridgeAndCloseUI(); |
| 158 void ShutdownBridgeAndShowUI(UIPage page, const base::string16& status); | 162 void ShutdownBridgeAndShowUI(UIPage page, const base::string16& status); |
| 159 void OnOptInPreferenceChanged(); | 163 void OnOptInPreferenceChanged(); |
| 160 void StartUI(); | 164 void StartUI(); |
| 161 void OnPrepareContextFailed(); | 165 void OnPrepareContextFailed(); |
| 166 void StartAndroidManagementClient(); | |
| 167 void CheckAndroidManagement(); | |
| 168 void OnAndroidManagementChecked(bool success); | |
| 162 | 169 |
| 163 // Unowned pointer. Keeps current profile. | 170 // Unowned pointer. Keeps current profile. |
| 164 Profile* profile_ = nullptr; | 171 Profile* profile_ = nullptr; |
| 165 // Owned by content::BrowserContent. Used to isolate cookies for auth server | 172 // Owned by content::BrowserContent. Used to isolate cookies for auth server |
| 166 // communication and shared with Arc OptIn UI platform app. | 173 // communication and shared with Arc OptIn UI platform app. |
| 167 content::StoragePartition* storage_partition_ = nullptr; | 174 content::StoragePartition* storage_partition_ = nullptr; |
| 168 | 175 |
| 169 // Registrar used to monitor ARC enabled state. | 176 // Registrar used to monitor ARC enabled state. |
| 170 PrefChangeRegistrar pref_change_registrar_; | 177 PrefChangeRegistrar pref_change_registrar_; |
| 171 | 178 |
| 172 mojo::Binding<AuthHost> binding_; | 179 mojo::Binding<AuthHost> binding_; |
| 173 State state_ = State::STOPPED; | 180 State state_ = State::STOPPED; |
| 174 base::ObserverList<Observer> observer_list_; | 181 base::ObserverList<Observer> observer_list_; |
| 175 std::unique_ptr<GaiaAuthFetcher> merger_fetcher_; | 182 std::unique_ptr<GaiaAuthFetcher> merger_fetcher_; |
| 176 std::unique_ptr<UbertokenFetcher> ubertoken_fethcher_; | 183 std::unique_ptr<UbertokenFetcher> ubertoken_fethcher_; |
| 177 std::string auth_code_; | 184 std::string auth_code_; |
| 178 GetAuthCodeCallback auth_callback_; | 185 GetAuthCodeCallback auth_callback_; |
| 179 bool initial_opt_in_ = false; | 186 bool initial_opt_in_ = false; |
| 180 bool context_prepared_ = false; | 187 bool context_prepared_ = false; |
| 181 UIPage ui_page_ = UIPage::NO_PAGE; | 188 UIPage ui_page_ = UIPage::NO_PAGE; |
| 182 base::string16 ui_page_status_; | 189 base::string16 ui_page_status_; |
| 190 std::string auth_token_; | |
|
bartfab (slow)
2016/04/18 15:06:15
Nit: #include <string>
Polina Bondarenko
2016/04/20 13:37:45
Done.
| |
| 191 | |
| 192 scoped_ptr<policy::AndroidManagementClient> android_management_client_; | |
|
bartfab (slow)
2016/04/18 15:06:15
Nit: Use std::unique_ptr instead.
Polina Bondarenko
2016/05/02 12:22:06
Done.
| |
| 183 | 193 |
| 184 DISALLOW_COPY_AND_ASSIGN(ArcAuthService); | 194 DISALLOW_COPY_AND_ASSIGN(ArcAuthService); |
| 185 }; | 195 }; |
| 186 | 196 |
| 187 std::ostream& operator<<(std::ostream& os, const ArcAuthService::State& state); | 197 std::ostream& operator<<(std::ostream& os, const ArcAuthService::State& state); |
| 188 | 198 |
| 189 } // namespace arc | 199 } // namespace arc |
| 190 | 200 |
| 191 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ | 201 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ |
| OLD | NEW |