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 <memory> | 8 #include <memory> |
9 #include <ostream> | 9 #include <ostream> |
10 #include <string> | 10 #include <string> |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 void StopAndEnableArc(); | 198 void StopAndEnableArc(); |
199 | 199 |
200 // Removes the data if ARC is stopped. Otherwise, queue to remove the data | 200 // Removes the data if ARC is stopped. Otherwise, queue to remove the data |
201 // on ARC is stopped. | 201 // on ARC is stopped. |
202 void RemoveArcData(); | 202 void RemoveArcData(); |
203 | 203 |
204 // Returns current page that has to be shown in OptIn UI. | 204 // Returns current page that has to be shown in OptIn UI. |
205 UIPage ui_page() const { return ui_page_; } | 205 UIPage ui_page() const { return ui_page_; } |
206 | 206 |
207 // Returns current page status, relevant to the specific page. | 207 // Returns current page status, relevant to the specific page. |
208 const base::string16& ui_page_status() { return ui_page_status_; } | 208 const base::string16& ui_page_status() const { return ui_page_status_; } |
209 | 209 |
210 private: | 210 private: |
211 void StartArc(); | 211 void StartArc(); |
212 void ShowUI(UIPage page, const base::string16& status); | 212 void ShowUI(UIPage page, const base::string16& status); |
213 void CloseUI(); | 213 void CloseUI(); |
214 void SetUIPage(UIPage page, const base::string16& status); | 214 void SetUIPage(UIPage page, const base::string16& status); |
215 void SetState(State state); | 215 void SetState(State state); |
216 void ShutdownBridge(); | 216 void ShutdownBridge(); |
217 void ShutdownBridgeAndCloseUI(); | 217 void ShutdownBridgeAndCloseUI(); |
218 void ShutdownBridgeAndShowUI(UIPage page, const base::string16& status); | 218 void ShutdownBridgeAndShowUI(UIPage page, const base::string16& status); |
219 void OnOptInPreferenceChanged(); | 219 void OnOptInPreferenceChanged(); |
220 void StartUI(); | 220 void StartUI(); |
221 void StartAndroidManagementClient(); | 221 void StartAndroidManagementClient(); |
222 void CheckAndroidManagement(bool background_mode); | 222 void CheckAndroidManagement(bool background_mode); |
223 void StartArcIfSignedIn(); | 223 void OnAndroidManagementPassed(); |
224 void OnArcDataRemoved(bool success); | 224 void OnArcDataRemoved(bool success); |
225 void OnArcSignInTimeout(); | 225 void OnArcSignInTimeout(); |
| 226 bool IsAuthCodeRequest() const; |
| 227 void FetchAuthCode(); |
| 228 void PrepareContextForAuthCodeRequest(); |
226 | 229 |
227 // Unowned pointer. Keeps current profile. | 230 // Unowned pointer. Keeps current profile. |
228 Profile* profile_ = nullptr; | 231 Profile* profile_ = nullptr; |
229 | 232 |
230 // Registrar used to monitor ARC enabled state. | 233 // Registrar used to monitor ARC enabled state. |
231 PrefChangeRegistrar pref_change_registrar_; | 234 PrefChangeRegistrar pref_change_registrar_; |
232 | 235 |
233 mojo::Binding<AuthHost> binding_; | 236 mojo::Binding<AuthHost> binding_; |
234 State state_ = State::NOT_INITIALIZED; | 237 State state_ = State::NOT_INITIALIZED; |
235 base::ObserverList<Observer> observer_list_; | 238 base::ObserverList<Observer> observer_list_; |
(...skipping 18 matching lines...) Expand all Loading... |
254 base::WeakPtrFactory<ArcAuthService> weak_ptr_factory_; | 257 base::WeakPtrFactory<ArcAuthService> weak_ptr_factory_; |
255 | 258 |
256 DISALLOW_COPY_AND_ASSIGN(ArcAuthService); | 259 DISALLOW_COPY_AND_ASSIGN(ArcAuthService); |
257 }; | 260 }; |
258 | 261 |
259 std::ostream& operator<<(std::ostream& os, const ArcAuthService::State& state); | 262 std::ostream& operator<<(std::ostream& os, const ArcAuthService::State& state); |
260 | 263 |
261 } // namespace arc | 264 } // namespace arc |
262 | 265 |
263 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ | 266 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ |
OLD | NEW |