root/chrome/browser/ui/webui/chromeos/login/reset_screen_handler.h

/* [<][>][^][v][top][bottom][index][help] */

INCLUDED FROM


// Copyright (c) 2012 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_UI_WEBUI_CHROMEOS_LOGIN_RESET_SCREEN_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_RESET_SCREEN_HANDLER_H_

#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/chromeos/login/help_app_launcher.h"
#include "chrome/browser/chromeos/login/screens/reset_screen_actor.h"
#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
#include "content/public/browser/web_ui.h"

namespace chromeos {

// WebUI implementation of ResetScreenActor.
class ResetScreenHandler : public ResetScreenActor,
                           public BaseScreenHandler {
 public:
  ResetScreenHandler();
  virtual ~ResetScreenHandler();

  // ResetScreenActor implementation:
  virtual void PrepareToShow() OVERRIDE;
  virtual void Show() OVERRIDE;
  virtual void Hide() OVERRIDE;
  virtual void SetDelegate(Delegate* delegate) OVERRIDE;

  // BaseScreenHandler implementation:
  virtual void DeclareLocalizedValues(LocalizedValuesBuilder* builder) OVERRIDE;
  virtual void Initialize() OVERRIDE;

  // WebUIMessageHandler implementation:
  virtual void RegisterMessages() OVERRIDE;

  void OnRollbackCheck(bool can_rollback);

 private:
  // JS messages handlers.
  void HandleOnCancel();
  void HandleOnRestart(bool should_rollback);
  void HandleOnPowerwash(bool rollback_checked);
  void HandleOnLearnMore();

  void ShowWithParams();

  Delegate* delegate_;

  // Help application used for help dialogs.
  scoped_refptr<HelpAppLauncher> help_app_;

  // Keeps whether screen should be shown right after initialization.
  bool show_on_init_;

  // Keeps whether restart is required before reset.
  // False if first exec after boot.
  bool restart_required_;

  // Keeps whether previous reboot was requested from reset screen. Makes sense
  // for first exec after boot situation.
  bool reboot_was_requested_;

  // Keeps whether rollback option is available fo.
  bool rollback_available_;

  base::WeakPtrFactory<ResetScreenHandler> weak_factory_;

  DISALLOW_COPY_AND_ASSIGN(ResetScreenHandler);
};

}  // namespace chromeos

#endif  // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_RESET_SCREEN_HANDLER_H_

/* [<][>][^][v][top][bottom][index][help] */