1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ERROR_SCREEN_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ERROR_SCREEN_HANDLER_H_
8 #include "base/macros.h"
9 #include "chrome/browser/chromeos/login/screens/network_error_view.h"
10 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
14 class NetworkErrorModel
;
16 // A class that handles the WebUI hooks in error screen.
17 class ErrorScreenHandler
: public BaseScreenHandler
, public NetworkErrorView
{
20 ~ErrorScreenHandler() override
;
23 void PrepareToShow() override
;
26 void Bind(NetworkErrorModel
& model
) override
;
27 void Unbind() override
;
28 void ShowScreen(OobeUI::Screen screen
) override
;
31 bool GetScreenName(OobeUI::Screen screen
, std::string
* name
) const;
33 // WebUI message handlers.
34 void HandleHideCaptivePortal();
36 // WebUIMessageHandler implementation:
37 void RegisterMessages() override
;
39 // BaseScreenHandler implementation:
40 void DeclareLocalizedValues(
41 ::login::LocalizedValuesBuilder
* builder
) override
;
42 void Initialize() override
;
45 NetworkErrorModel
* model_
;
47 // Keeps whether screen should be shown right after initialization.
50 base::WeakPtrFactory
<ErrorScreenHandler
> weak_ptr_factory_
;
52 DISALLOW_COPY_AND_ASSIGN(ErrorScreenHandler
);
55 } // namespace chromeos
57 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ERROR_SCREEN_HANDLER_H_