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 current session. |
| 93 bool IsAllowed() const; |
| 94 |
92 void OnPrimaryUserProfilePrepared(Profile* profile); | 95 void OnPrimaryUserProfilePrepared(Profile* profile); |
93 void Shutdown(); | 96 void Shutdown(); |
94 | 97 |
95 State state() const { return state_; } | 98 State state() const { return state_; } |
96 | 99 |
97 std::string GetAndResetAuthCode(); | 100 std::string GetAndResetAuthCode(); |
98 | 101 |
99 // Adds or removes observers. | 102 // Adds or removes observers. |
100 void AddObserver(Observer* observer); | 103 void AddObserver(Observer* observer); |
101 void RemoveObserver(Observer* observer); | 104 void RemoveObserver(Observer* observer); |
(...skipping 16 matching lines...) Expand all Loading... |
118 | 121 |
119 // Called from Arc support platform app to start LSO. | 122 // Called from Arc support platform app to start LSO. |
120 void StartLso(); | 123 void StartLso(); |
121 | 124 |
122 // Called from Arc support platform app to set auth code and start arc. | 125 // Called from Arc support platform app to set auth code and start arc. |
123 void SetAuthCodeAndStartArc(const std::string& auth_code); | 126 void SetAuthCodeAndStartArc(const std::string& auth_code); |
124 | 127 |
125 // Called from Arc support platform app when user cancels signing. | 128 // Called from Arc support platform app when user cancels signing. |
126 void CancelAuthCode(); | 129 void CancelAuthCode(); |
127 | 130 |
| 131 bool IsArcEnabled(); |
128 void EnableArc(); | 132 void EnableArc(); |
129 void DisableArc(); | 133 void DisableArc(); |
130 | 134 |
131 // UbertokenConsumer: | 135 // UbertokenConsumer: |
132 void OnUbertokenSuccess(const std::string& token) override; | 136 void OnUbertokenSuccess(const std::string& token) override; |
133 void OnUbertokenFailure(const GoogleServiceAuthError& error) override; | 137 void OnUbertokenFailure(const GoogleServiceAuthError& error) override; |
134 | 138 |
135 // GaiaAuthConsumer: | 139 // GaiaAuthConsumer: |
136 void OnMergeSessionSuccess(const std::string& data) override; | 140 void OnMergeSessionSuccess(const std::string& data) override; |
137 void OnMergeSessionFailure(const GoogleServiceAuthError& error) override; | 141 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_; | 188 base::string16 ui_page_status_; |
185 | 189 |
186 DISALLOW_COPY_AND_ASSIGN(ArcAuthService); | 190 DISALLOW_COPY_AND_ASSIGN(ArcAuthService); |
187 }; | 191 }; |
188 | 192 |
189 std::ostream& operator<<(std::ostream& os, const ArcAuthService::State& state); | 193 std::ostream& operator<<(std::ostream& os, const ArcAuthService::State& state); |
190 | 194 |
191 } // namespace arc | 195 } // namespace arc |
192 | 196 |
193 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ | 197 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ |
OLD | NEW |