| 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 void OnSyncedPrefChanged(const std::string& path, bool from_sync) override; | 163 void OnSyncedPrefChanged(const std::string& path, bool from_sync) override; |
| 164 | 164 |
| 165 // ArcAuthContextDelegate: | 165 // ArcAuthContextDelegate: |
| 166 void OnContextReady() override; | 166 void OnContextReady() override; |
| 167 void OnPrepareContextFailed() override; | 167 void OnPrepareContextFailed() override; |
| 168 | 168 |
| 169 // ArcAndroidManagementCheckerDelegate: | 169 // ArcAndroidManagementCheckerDelegate: |
| 170 void OnAndroidManagementChecked( | 170 void OnAndroidManagementChecked( |
| 171 policy::AndroidManagementClient::Result result) override; | 171 policy::AndroidManagementClient::Result result) override; |
| 172 | 172 |
| 173 void StopArc(); |
| 174 void RestartArc(); |
| 175 |
| 173 // Returns current page that has to be shown in OptIn UI. | 176 // Returns current page that has to be shown in OptIn UI. |
| 174 UIPage ui_page() const { return ui_page_; } | 177 UIPage ui_page() const { return ui_page_; } |
| 175 | 178 |
| 176 // Returns current page status, relevant to the specific page. | 179 // Returns current page status, relevant to the specific page. |
| 177 const base::string16& ui_page_status() { return ui_page_status_; } | 180 const base::string16& ui_page_status() { return ui_page_status_; } |
| 178 | 181 |
| 179 private: | 182 private: |
| 180 void StartArc(); | 183 void StartArc(); |
| 181 void ShowUI(UIPage page, const base::string16& status); | 184 void ShowUI(UIPage page, const base::string16& status); |
| 182 void CloseUI(); | 185 void CloseUI(); |
| 183 void SetUIPage(UIPage page, const base::string16& status); | 186 void SetUIPage(UIPage page, const base::string16& status); |
| 184 void SetState(State state); | 187 void SetState(State state); |
| 185 void ShutdownBridge(); | 188 void ShutdownBridge(); |
| 186 void ShutdownBridgeAndCloseUI(); | 189 void ShutdownBridgeAndCloseUI(); |
| 187 void ShutdownBridgeAndShowUI(UIPage page, const base::string16& status); | 190 void ShutdownBridgeAndShowUI(UIPage page, const base::string16& status); |
| 188 void OnOptInPreferenceChanged(); | 191 void OnOptInPreferenceChanged(); |
| 189 void StartUI(); | 192 void StartUI(); |
| 190 void StartAndroidManagementClient(); | 193 void StartAndroidManagementClient(); |
| 191 void CheckAndroidManagement(bool background_mode); | 194 void CheckAndroidManagement(bool background_mode); |
| 192 void StartArcIfSignedIn(); | 195 void StartArcIfSignedIn(); |
| 193 void StopArc(); | |
| 194 | 196 |
| 195 // Unowned pointer. Keeps current profile. | 197 // Unowned pointer. Keeps current profile. |
| 196 Profile* profile_ = nullptr; | 198 Profile* profile_ = nullptr; |
| 197 | 199 |
| 198 // Registrar used to monitor ARC enabled state. | 200 // Registrar used to monitor ARC enabled state. |
| 199 PrefChangeRegistrar pref_change_registrar_; | 201 PrefChangeRegistrar pref_change_registrar_; |
| 200 | 202 |
| 201 mojo::Binding<AuthHost> binding_; | 203 mojo::Binding<AuthHost> binding_; |
| 202 State state_ = State::NOT_INITIALIZED; | 204 State state_ = State::NOT_INITIALIZED; |
| 203 base::ObserverList<Observer> observer_list_; | 205 base::ObserverList<Observer> observer_list_; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 219 base::WeakPtrFactory<ArcAuthService> weak_ptr_factory_; | 221 base::WeakPtrFactory<ArcAuthService> weak_ptr_factory_; |
| 220 | 222 |
| 221 DISALLOW_COPY_AND_ASSIGN(ArcAuthService); | 223 DISALLOW_COPY_AND_ASSIGN(ArcAuthService); |
| 222 }; | 224 }; |
| 223 | 225 |
| 224 std::ostream& operator<<(std::ostream& os, const ArcAuthService::State& state); | 226 std::ostream& operator<<(std::ostream& os, const ArcAuthService::State& state); |
| 225 | 227 |
| 226 } // namespace arc | 228 } // namespace arc |
| 227 | 229 |
| 228 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ | 230 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ |
| OLD | NEW |