Chromium Code Reviews| Index: chrome/browser/chromeos/first_run/drive_opt_in_controller.h |
| diff --git a/chrome/browser/chromeos/first_run/drive_opt_in_controller.h b/chrome/browser/chromeos/first_run/drive_opt_in_controller.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..55eb4a9880b2f224b368867d2bfa0bcbe93cb211 |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/first_run/drive_opt_in_controller.h |
| @@ -0,0 +1,46 @@ |
| +// Copyright 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_CHROMEOS_FIRST_RUN_DRIVE_OPT_IN_CONTROLLER_H_ |
| +#define CHROME_BROWSER_CHROMEOS_FIRST_RUN_DRIVE_OPT_IN_CONTROLLER_H_ |
| + |
| +#include "base/basictypes.h" |
| +#include "base/timer/timer.h" |
| +#include "chrome/browser/profiles/profile.h" |
| + |
| +namespace chromeos { |
| + |
| +class DriveOptInWebContentsManager; |
| + |
| +// This class is responsible for kicking off the Google Drive offline |
| +// initialization process. There is an initial delay to avoid contention when |
| +// the session starts. DriveOptInController will manage its own lifetime and |
| +// destroy itself when the opt-in succeeds or fails. |
| +class DriveOptInController { |
| + public: |
| + DriveOptInController(); |
| + virtual ~DriveOptInController(); |
|
achuithb
2013/11/01 19:25:15
Should this method be virtual?
Tim Song
2013/11/02 00:13:14
Done.
|
| + |
| + void StartOfflineOptIn(); |
| + |
| + private: |
| + 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.
|
| + |
| + void OnOptInSuccess(); |
| + void OnOptInFailure(); |
| + void OnWebContentsTimedOut(); |
| + void CleanUp(); |
| + |
| + Profile* profile_; |
| + scoped_ptr<DriveOptInWebContentsManager> web_contents_manager_; |
| + base::OneShotTimer<DriveOptInController> web_contents_timer_; |
| + base::OneShotTimer<DriveOptInController> initial_delay_timer_; |
| + bool initial_delay_done_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DriveOptInController); |
| +}; |
| + |
| +} // namespace chromeos |
| + |
| +#endif // CHROME_BROWSER_CHROMEOS_FIRST_RUN_DRIVE_OPT_IN_CONTROLLER_H_ |