| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 static ArcAuthService* Get(); | 82 static ArcAuthService* Get(); |
| 83 | 83 |
| 84 // It is called from chrome/browser/prefs/browser_prefs.cc. | 84 // It is called from chrome/browser/prefs/browser_prefs.cc. |
| 85 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 85 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
| 86 | 86 |
| 87 static void DisableUIForTesting(); | 87 static void DisableUIForTesting(); |
| 88 | 88 |
| 89 // Checks if OptIn verification was disabled by switch in command line. | 89 // Checks if OptIn verification was disabled by switch in command line. |
| 90 static bool IsOptInVerificationDisabled(); | 90 static bool IsOptInVerificationDisabled(); |
| 91 | 91 |
| 92 // Returns true if Arc is allowed to run for the given profile. |
| 93 static bool IsAllowedForProfile(const Profile* profile); |
| 94 |
| 95 // Returns true if Arc is allowed to run for the current session. |
| 96 bool IsAllowed() const; |
| 97 |
| 92 void OnPrimaryUserProfilePrepared(Profile* profile); | 98 void OnPrimaryUserProfilePrepared(Profile* profile); |
| 93 void Shutdown(); | 99 void Shutdown(); |
| 94 | 100 |
| 95 State state() const { return state_; } | 101 State state() const { return state_; } |
| 96 | 102 |
| 97 std::string GetAndResetAuthCode(); | 103 std::string GetAndResetAuthCode(); |
| 98 | 104 |
| 99 // Adds or removes observers. | 105 // Adds or removes observers. |
| 100 void AddObserver(Observer* observer); | 106 void AddObserver(Observer* observer); |
| 101 void RemoveObserver(Observer* observer); | 107 void RemoveObserver(Observer* observer); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 118 | 124 |
| 119 // Called from Arc support platform app to start LSO. | 125 // Called from Arc support platform app to start LSO. |
| 120 void StartLso(); | 126 void StartLso(); |
| 121 | 127 |
| 122 // Called from Arc support platform app to set auth code and start arc. | 128 // Called from Arc support platform app to set auth code and start arc. |
| 123 void SetAuthCodeAndStartArc(const std::string& auth_code); | 129 void SetAuthCodeAndStartArc(const std::string& auth_code); |
| 124 | 130 |
| 125 // Called from Arc support platform app when user cancels signing. | 131 // Called from Arc support platform app when user cancels signing. |
| 126 void CancelAuthCode(); | 132 void CancelAuthCode(); |
| 127 | 133 |
| 134 bool IsArcEnabled(); |
| 128 void EnableArc(); | 135 void EnableArc(); |
| 129 void DisableArc(); | 136 void DisableArc(); |
| 130 | 137 |
| 131 // UbertokenConsumer: | 138 // UbertokenConsumer: |
| 132 void OnUbertokenSuccess(const std::string& token) override; | 139 void OnUbertokenSuccess(const std::string& token) override; |
| 133 void OnUbertokenFailure(const GoogleServiceAuthError& error) override; | 140 void OnUbertokenFailure(const GoogleServiceAuthError& error) override; |
| 134 | 141 |
| 135 // GaiaAuthConsumer: | 142 // GaiaAuthConsumer: |
| 136 void OnMergeSessionSuccess(const std::string& data) override; | 143 void OnMergeSessionSuccess(const std::string& data) override; |
| 137 void OnMergeSessionFailure(const GoogleServiceAuthError& error) override; | 144 void OnMergeSessionFailure(const GoogleServiceAuthError& error) override; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 base::string16 ui_page_status_; | 191 base::string16 ui_page_status_; |
| 185 | 192 |
| 186 DISALLOW_COPY_AND_ASSIGN(ArcAuthService); | 193 DISALLOW_COPY_AND_ASSIGN(ArcAuthService); |
| 187 }; | 194 }; |
| 188 | 195 |
| 189 std::ostream& operator<<(std::ostream& os, const ArcAuthService::State& state); | 196 std::ostream& operator<<(std::ostream& os, const ArcAuthService::State& state); |
| 190 | 197 |
| 191 } // namespace arc | 198 } // namespace arc |
| 192 | 199 |
| 193 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ | 200 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ |
| OLD | NEW |