OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_EULA_SCREEN_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_EULA_SCREEN_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_EULA_SCREEN_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_EULA_SCREEN_HANDLER_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "chrome/browser/chromeos/login/screens/eula_view.h" | 11 #include "chrome/browser/chromeos/login/screens/eula_view.h" |
12 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" | 12 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
13 #include "chromeos/tpm/tpm_password_fetcher.h" | 13 #include "chromeos/tpm/tpm_password_fetcher.h" |
14 #include "content/public/browser/web_ui.h" | 14 #include "content/public/browser/web_ui.h" |
15 | 15 |
16 namespace base { | 16 namespace base { |
17 class DictionaryValue; | 17 class DictionaryValue; |
18 } | 18 } |
19 | 19 |
20 namespace chromeos { | 20 namespace chromeos { |
21 | 21 |
22 class CoreOobeActor; | 22 class CoreOobeView; |
23 class HelpAppLauncher; | 23 class HelpAppLauncher; |
24 | 24 |
25 // WebUI implementation of EulaScreenActor. It is used to interact | 25 // WebUI implementation of EulaScreenView. It is used to interact |
26 // with the eula part of the JS page. | 26 // with the eula part of the JS page. |
27 class EulaScreenHandler : public EulaView, | 27 class EulaScreenHandler : public EulaView, |
28 public BaseScreenHandler, | 28 public BaseScreenHandler, |
29 public TpmPasswordFetcherDelegate { | 29 public TpmPasswordFetcherDelegate { |
30 public: | 30 public: |
31 explicit EulaScreenHandler(CoreOobeActor* core_oobe_actor); | 31 explicit EulaScreenHandler(CoreOobeView* core_oobe_view); |
32 ~EulaScreenHandler() override; | 32 ~EulaScreenHandler() override; |
33 | 33 |
34 // EulaView implementation: | 34 // EulaView implementation: |
35 void Show() override; | 35 void Show() override; |
36 void Hide() override; | 36 void Hide() override; |
37 void Bind(EulaScreen* screen) override; | 37 void Bind(EulaScreen* screen) override; |
38 void Unbind() override; | 38 void Unbind() override; |
39 void OnPasswordFetched(const std::string& tpm_password) override; | 39 void OnPasswordFetched(const std::string& tpm_password) override; |
40 | 40 |
41 // BaseScreenHandler implementation: | 41 // BaseScreenHandler implementation: |
42 void DeclareLocalizedValues( | 42 void DeclareLocalizedValues( |
43 ::login::LocalizedValuesBuilder* builder) override; | 43 ::login::LocalizedValuesBuilder* builder) override; |
44 void DeclareJSCallbacks() override; | 44 void DeclareJSCallbacks() override; |
45 void GetAdditionalParameters(base::DictionaryValue* dict) override; | 45 void GetAdditionalParameters(base::DictionaryValue* dict) override; |
46 void Initialize() override; | 46 void Initialize() override; |
47 | 47 |
48 private: | 48 private: |
49 // JS messages handlers. | 49 // JS messages handlers. |
50 void HandleOnLearnMore(); | 50 void HandleOnLearnMore(); |
51 void HandleOnChromeCredits(); | 51 void HandleOnChromeCredits(); |
52 void HandleOnChromeOSCredits(); | 52 void HandleOnChromeOSCredits(); |
53 void HandleOnInstallationSettingsPopupOpened(); | 53 void HandleOnInstallationSettingsPopupOpened(); |
54 | 54 |
55 EulaScreen* screen_ = nullptr; | 55 EulaScreen* screen_ = nullptr; |
56 CoreOobeActor* core_oobe_actor_ = nullptr; | 56 CoreOobeView* core_oobe_view_ = nullptr; |
57 | 57 |
58 // Help application used for help dialogs. | 58 // Help application used for help dialogs. |
59 scoped_refptr<HelpAppLauncher> help_app_; | 59 scoped_refptr<HelpAppLauncher> help_app_; |
60 | 60 |
61 // Keeps whether screen should be shown right after initialization. | 61 // Keeps whether screen should be shown right after initialization. |
62 bool show_on_init_ = false; | 62 bool show_on_init_ = false; |
63 | 63 |
64 DISALLOW_COPY_AND_ASSIGN(EulaScreenHandler); | 64 DISALLOW_COPY_AND_ASSIGN(EulaScreenHandler); |
65 }; | 65 }; |
66 | 66 |
67 } // namespace chromeos | 67 } // namespace chromeos |
68 | 68 |
69 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_EULA_SCREEN_HANDLER_H_ | 69 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_EULA_SCREEN_HANDLER_H_ |
OLD | NEW |