#include <string>
#include "base/compiler_specific.h"
+#include "base/time/time.h"
+#include "base/timer/timer.h"
#include "chrome/browser/chromeos/login/screens/network_screen_actor.h"
#include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
#include "ui/gfx/point.h"
+class PrefRegistrySimple;
+
namespace chromeos {
class CoreOobeActor;
+class IdleDetector;
struct NetworkScreenHandlerOnLanguageChangedCallbackData;
// WebUIMessageHandler implementation:
virtual void RegisterMessages() OVERRIDE;
+ // Registers the preference for derelict state.
+ static void RegisterPrefs(PrefRegistrySimple* registry);
+
private:
// Handles moving off the screen.
void HandleOnExit();
// Callback when the system timezone settings is changed.
void OnSystemTimezoneChanged();
+ // Demo mode detection methods.
+ void StartIdleDetection();
+ void StartOobeTimer();
+ void OnIdle();
+ void OnOobeTimerUpdate();
+ void SetupTimeouts();
+ bool IsDerelict();
+
// Returns available languages. Caller gets the ownership. Note, it does
// depend on the current locale.
static base::ListValue* GetLanguageList();
bool is_continue_enabled_;
+ // Total time this machine has spent on OOBE.
+ base::TimeDelta time_on_oobe_;
+
// Keeps whether screen should be shown right after initialization.
bool show_on_init_;
scoped_ptr<CrosSettings::ObserverSubscription> timezone_subscription_;
+ scoped_ptr<IdleDetector> detector_;
+
+ base::RepeatingTimer<NetworkScreenHandler> oobe_timer_;
+
+ // Timeout to detect if the machine is in a derelict state.
+ base::TimeDelta derelict_detection_timeout_;
+ // Timeout before showing our demo up if the machine is in a derelict state.
+ base::TimeDelta derelict_idle_timeout_;
+ // Time between updating our total time on oobe.
+ base::TimeDelta oobe_timer_update_interval_;
+
base::WeakPtrFactory<NetworkScreenHandler> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(NetworkScreenHandler);