Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: chrome/browser/chromeos/arc/arc_auth_service.h

Issue 2323043003: arc: Add a global 5 minute timeout for ARC opt-in (Closed)
Patch Set: nits Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_auth_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 #include "base/observer_list.h" 14 #include "base/observer_list.h"
15 #include "base/timer/timer.h"
15 #include "chrome/browser/chromeos/arc/arc_android_management_checker_delegate.h" 16 #include "chrome/browser/chromeos/arc/arc_android_management_checker_delegate.h"
16 #include "chrome/browser/chromeos/arc/arc_auth_code_fetcher_delegate.h" 17 #include "chrome/browser/chromeos/arc/arc_auth_code_fetcher_delegate.h"
17 #include "chrome/browser/chromeos/arc/arc_auth_context_delegate.h" 18 #include "chrome/browser/chromeos/arc/arc_auth_context_delegate.h"
18 #include "components/arc/arc_bridge_service.h" 19 #include "components/arc/arc_bridge_service.h"
19 #include "components/arc/arc_service.h" 20 #include "components/arc/arc_service.h"
20 #include "components/arc/common/auth.mojom.h" 21 #include "components/arc/common/auth.mojom.h"
21 #include "components/arc/instance_holder.h" 22 #include "components/arc/instance_holder.h"
22 #include "components/prefs/pref_change_registrar.h" 23 #include "components/prefs/pref_change_registrar.h"
23 #include "components/syncable_prefs/pref_service_syncable_observer.h" 24 #include "components/syncable_prefs/pref_service_syncable_observer.h"
24 #include "components/syncable_prefs/synced_pref_observer.h" 25 #include "components/syncable_prefs/synced_pref_observer.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 void SetState(State state); 213 void SetState(State state);
213 void ShutdownBridge(); 214 void ShutdownBridge();
214 void ShutdownBridgeAndCloseUI(); 215 void ShutdownBridgeAndCloseUI();
215 void ShutdownBridgeAndShowUI(UIPage page, const base::string16& status); 216 void ShutdownBridgeAndShowUI(UIPage page, const base::string16& status);
216 void OnOptInPreferenceChanged(); 217 void OnOptInPreferenceChanged();
217 void StartUI(); 218 void StartUI();
218 void StartAndroidManagementClient(); 219 void StartAndroidManagementClient();
219 void CheckAndroidManagement(bool background_mode); 220 void CheckAndroidManagement(bool background_mode);
220 void StartArcIfSignedIn(); 221 void StartArcIfSignedIn();
221 void OnArcDataRemoved(bool success); 222 void OnArcDataRemoved(bool success);
223 void OnArcSignInTimeout();
222 224
223 // Unowned pointer. Keeps current profile. 225 // Unowned pointer. Keeps current profile.
224 Profile* profile_ = nullptr; 226 Profile* profile_ = nullptr;
225 227
226 // Registrar used to monitor ARC enabled state. 228 // Registrar used to monitor ARC enabled state.
227 PrefChangeRegistrar pref_change_registrar_; 229 PrefChangeRegistrar pref_change_registrar_;
228 230
229 mojo::Binding<AuthHost> binding_; 231 mojo::Binding<AuthHost> binding_;
230 State state_ = State::NOT_INITIALIZED; 232 State state_ = State::NOT_INITIALIZED;
231 base::ObserverList<Observer> observer_list_; 233 base::ObserverList<Observer> observer_list_;
232 std::unique_ptr<ArcAppLauncher> playstore_launcher_; 234 std::unique_ptr<ArcAppLauncher> playstore_launcher_;
233 std::string auth_code_; 235 std::string auth_code_;
234 GetAuthCodeCallback auth_callback_; 236 GetAuthCodeCallback auth_callback_;
235 bool initial_opt_in_ = false; 237 bool initial_opt_in_ = false;
236 bool disable_arc_from_ui_ = false; 238 bool disable_arc_from_ui_ = false;
237 UIPage ui_page_ = UIPage::NO_PAGE; 239 UIPage ui_page_ = UIPage::NO_PAGE;
238 base::string16 ui_page_status_; 240 base::string16 ui_page_status_;
239 bool clear_required_ = false; 241 bool clear_required_ = false;
240 bool reenable_arc_ = false; 242 bool reenable_arc_ = false;
241 bool waiting_for_reply_ = false; 243 base::OneShotTimer arc_sign_in_timer_;
242 244
243 std::unique_ptr<ArcAuthContext> context_; 245 std::unique_ptr<ArcAuthContext> context_;
244 std::unique_ptr<ArcAuthCodeFetcher> auth_code_fetcher_; 246 std::unique_ptr<ArcAuthCodeFetcher> auth_code_fetcher_;
245 std::unique_ptr<ArcAndroidManagementChecker> android_management_checker_; 247 std::unique_ptr<ArcAndroidManagementChecker> android_management_checker_;
246 248
247 base::Time sign_in_time_; 249 base::Time sign_in_time_;
248 250
249 base::WeakPtrFactory<ArcAuthService> weak_ptr_factory_; 251 base::WeakPtrFactory<ArcAuthService> weak_ptr_factory_;
250 252
251 DISALLOW_COPY_AND_ASSIGN(ArcAuthService); 253 DISALLOW_COPY_AND_ASSIGN(ArcAuthService);
252 }; 254 };
253 255
254 std::ostream& operator<<(std::ostream& os, const ArcAuthService::State& state); 256 std::ostream& operator<<(std::ostream& os, const ArcAuthService::State& state);
255 257
256 } // namespace arc 258 } // namespace arc
257 259
258 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ 260 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_auth_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698