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"
11 #include "chrome/browser/ui/webui/chromeos/login/network_dropdown_handler.h"
15 class NetworkErrorModel
;
17 // A class that handles the WebUI hooks in error screen.
18 class ErrorScreenHandler
: public BaseScreenHandler
,
19 public NetworkErrorView
,
20 public NetworkDropdownHandler::Observer
{
23 ~ErrorScreenHandler() override
;
26 void PrepareToShow() override
;
29 void Bind(NetworkErrorModel
& model
) override
;
30 void Unbind() override
;
31 void ShowScreen(OobeUI::Screen screen
) override
;
34 bool GetScreenName(OobeUI::Screen screen
, std::string
* name
) const;
36 // WebUI message handlers.
37 void HandleHideCaptivePortal();
39 // WebUIMessageHandler implementation:
40 void RegisterMessages() override
;
42 // BaseScreenHandler implementation:
43 void DeclareLocalizedValues(
44 ::login::LocalizedValuesBuilder
* builder
) override
;
45 void Initialize() override
;
47 // NetworkDropdownHandler:
48 void OnConnectToNetworkRequested() override
;
51 NetworkErrorModel
* model_
;
53 // Keeps whether screen should be shown right after initialization.
56 // Whether the error screen is currently shown.
59 base::WeakPtrFactory
<ErrorScreenHandler
> weak_ptr_factory_
;
61 DISALLOW_COPY_AND_ASSIGN(ErrorScreenHandler
);
64 } // namespace chromeos
66 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_ERROR_SCREEN_HANDLER_H_