blob: 7f074ec6eb97ee80a2a5400ab4a596bd0ad048d1 [file] [log] [blame]
// Copyright 2018 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/macros.h"
#include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/discover/discover_ui.h"
namespace chromeos {
class DiscoverScreen;
// Interface for dependency injection between DiscoverScreen and its
// WebUI representation.
class DiscoverScreenView {
constexpr static StaticOobeScreenId kScreenId{"discover"};
virtual ~DiscoverScreenView() = default;
// Sets screen this view belongs to.
virtual void Bind(DiscoverScreen* screen) = 0;
// Shows the contents of the screen.
virtual void Show() = 0;
// Hides the contents of the screen.
virtual void Hide() = 0;
// The sole implementation of the DiscoverScreenView, using WebUI.
class DiscoverScreenHandler : public BaseScreenHandler,
public DiscoverScreenView {
using TView = DiscoverScreenView;
explicit DiscoverScreenHandler(JSCallsContainer* js_calls_container);
~DiscoverScreenHandler() override;
// BaseScreenHandler:
void DeclareLocalizedValues(
::login::LocalizedValuesBuilder* builder) override;
void GetAdditionalParameters(base::DictionaryValue* dict) override;
void RegisterMessages() override;
// DiscoverScreenView:
void Bind(DiscoverScreen* screen) override;
void Hide() override;
void Initialize() override;
void Show() override;
DiscoverScreen* screen_ = nullptr;
DiscoverUI discover_ui_;
} // namespace chromeos