Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / webui / chromeos / login / eula_screen_handler.h
blob09650e80b7ce0983cd0ff3e37cf9546cd6d4bb18
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_EULA_SCREEN_HANDLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_EULA_SCREEN_HANDLER_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h"
10 #include "chrome/browser/chromeos/login/screens/eula_view.h"
11 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
12 #include "chromeos/tpm/tpm_password_fetcher.h"
13 #include "content/public/browser/web_ui.h"
15 namespace base {
16 class DictionaryValue;
19 namespace chromeos {
21 class CoreOobeActor;
22 class HelpAppLauncher;
24 // WebUI implementation of EulaScreenActor. It is used to interact
25 // with the eula part of the JS page.
26 class EulaScreenHandler : public EulaView,
27 public BaseScreenHandler,
28 public TpmPasswordFetcherDelegate {
29 public:
30 explicit EulaScreenHandler(CoreOobeActor* core_oobe_actor);
31 ~EulaScreenHandler() override;
33 // EulaView implementation:
34 void PrepareToShow() override;
35 void Show() override;
36 void Hide() override;
37 void Bind(EulaModel& model) override;
38 void Unbind() override;
39 void OnPasswordFetched(const std::string& tpm_password) override;
41 // BaseScreenHandler implementation:
42 void DeclareLocalizedValues(
43 ::login::LocalizedValuesBuilder* builder) override;
44 void DeclareJSCallbacks() override;
45 void GetAdditionalParameters(base::DictionaryValue* dict) override;
46 void Initialize() override;
48 private:
49 // JS messages handlers.
50 void HandleOnLearnMore();
51 void HandleOnChromeCredits();
52 void HandleOnChromeOSCredits();
53 void HandleOnInstallationSettingsPopupOpened();
55 EulaModel* model_;
56 CoreOobeActor* core_oobe_actor_;
58 // Help application used for help dialogs.
59 scoped_refptr<HelpAppLauncher> help_app_;
61 // Keeps whether screen should be shown right after initialization.
62 bool show_on_init_;
64 DISALLOW_COPY_AND_ASSIGN(EulaScreenHandler);
67 } // namespace chromeos
69 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_EULA_SCREEN_HANDLER_H_