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