ProfilePolicyConnectorFactory: Refactoring from Profile to BrowserContext.
[chromium-blink-merge.git] / chrome / browser / ui / webui / chromeos / login / error_screen_handler.h
blob4f2ce08c54775340b9c02ce2e799606128e0e715
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"
12 namespace chromeos {
14 class NetworkErrorModel;
16 // A class that handles the WebUI hooks in error screen.
17 class ErrorScreenHandler : public BaseScreenHandler, public NetworkErrorView {
18 public:
19 ErrorScreenHandler();
20 ~ErrorScreenHandler() override;
22 // ErrorView:
23 void PrepareToShow() override;
24 void Show() override;
25 void Hide() override;
26 void Bind(NetworkErrorModel& model) override;
27 void Unbind() override;
28 void ShowScreen(OobeUI::Screen screen) override;
30 private:
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;
44 // Non-owning ptr.
45 NetworkErrorModel* model_;
47 // Keeps whether screen should be shown right after initialization.
48 bool show_on_init_;
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_