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