Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_FIRST_RUN_DRIVE_OPT_IN_CONTROLLER_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_FIRST_RUN_DRIVE_OPT_IN_CONTROLLER_H_ | |
| 7 | |
| 8 #include "base/basictypes.h" | |
| 9 #include "base/timer/timer.h" | |
| 10 #include "chrome/browser/profiles/profile.h" | |
| 11 | |
| 12 namespace chromeos { | |
| 13 | |
| 14 class DriveOptInWebContentsManager; | |
| 15 | |
| 16 // This class is responsible for kicking off the Google Drive offline | |
| 17 // initialization process. There is an initial delay to avoid contention when | |
| 18 // the session starts. DriveOptInController will manage its own lifetime and | |
| 19 // destroy itself when the opt-in succeeds or fails. | |
| 20 class DriveOptInController { | |
| 21 public: | |
| 22 DriveOptInController(); | |
| 23 virtual ~DriveOptInController(); | |
|
achuithb
2013/11/01 19:25:15
Should this method be virtual?
Tim Song
2013/11/02 00:13:14
Done.
| |
| 24 | |
| 25 void StartOfflineOptIn(); | |
| 26 | |
| 27 private: | |
| 28 friend class DriveOptInWebContentsManager; | |
|
achuithb
2013/11/01 19:25:15
Could we get rid of the friend relationship here,
Tim Song
2013/11/02 00:13:14
Done.
| |
| 29 | |
| 30 void OnOptInSuccess(); | |
| 31 void OnOptInFailure(); | |
| 32 void OnWebContentsTimedOut(); | |
| 33 void CleanUp(); | |
| 34 | |
| 35 Profile* profile_; | |
| 36 scoped_ptr<DriveOptInWebContentsManager> web_contents_manager_; | |
| 37 base::OneShotTimer<DriveOptInController> web_contents_timer_; | |
| 38 base::OneShotTimer<DriveOptInController> initial_delay_timer_; | |
| 39 bool initial_delay_done_; | |
| 40 | |
| 41 DISALLOW_COPY_AND_ASSIGN(DriveOptInController); | |
| 42 }; | |
| 43 | |
| 44 } // namespace chromeos | |
| 45 | |
| 46 #endif // CHROME_BROWSER_CHROMEOS_FIRST_RUN_DRIVE_OPT_IN_CONTROLLER_H_ | |
| OLD | NEW |