blob: 11ab99168964b40facc783f6d4bbe881a53fe515 [file] [log] [blame]
// Copyright (c) 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.
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
#include "content/public/browser/web_ui.h"
namespace chromeos {
class WrongHWIDScreen;
// Interface between wrong HWID screen and its representation.
// Note, do not forget to call OnViewDestroyed in the dtor.
class WrongHWIDScreenView {
constexpr static StaticOobeScreenId kScreenId{"wrong-hwid"};
virtual ~WrongHWIDScreenView() {}
virtual void Show() = 0;
virtual void Hide() = 0;
virtual void SetDelegate(WrongHWIDScreen* delegate) = 0;
// WebUI implementation of WrongHWIDScreenActor.
class WrongHWIDScreenHandler : public WrongHWIDScreenView,
public BaseScreenHandler {
using TView = WrongHWIDScreenView;
explicit WrongHWIDScreenHandler(JSCallsContainer* js_calls_container);
~WrongHWIDScreenHandler() override;
// WrongHWIDScreenActor implementation:
void Show() override;
void Hide() override;
void SetDelegate(WrongHWIDScreen* delegate) override;
// BaseScreenHandler implementation:
void DeclareLocalizedValues(
::login::LocalizedValuesBuilder* builder) override;
void Initialize() override;
// WebUIMessageHandler implementation:
void RegisterMessages() override;
// JS messages handlers.
void HandleOnSkip();
WrongHWIDScreen* delegate_ = nullptr;
// Keeps whether screen should be shown right after initialization.
bool show_on_init_ = false;
} // namespace chromeos