| 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/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "chrome/browser/chromeos/login/screens/eula_screen_actor.h" | 10 #include "chrome/browser/chromeos/login/screens/eula_view.h" |
| 11 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" | 11 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
| 12 #include "chromeos/tpm_password_fetcher.h" | 12 #include "chromeos/tpm_password_fetcher.h" |
| 13 #include "content/public/browser/web_ui.h" | 13 #include "content/public/browser/web_ui.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class DictionaryValue; | 16 class DictionaryValue; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace chromeos { | 19 namespace chromeos { |
| 20 | 20 |
| 21 class CoreOobeActor; | 21 class CoreOobeActor; |
| 22 class HelpAppLauncher; | 22 class HelpAppLauncher; |
| 23 | 23 |
| 24 // WebUI implementation of EulaScreenActor. It is used to interact | 24 // WebUI implementation of EulaScreenActor. It is used to interact |
| 25 // with the eula part of the JS page. | 25 // with the eula part of the JS page. |
| 26 class EulaScreenHandler : public EulaScreenActor, | 26 class EulaScreenHandler : public EulaView, |
| 27 public BaseScreenHandler, | 27 public BaseScreenHandler, |
| 28 public TpmPasswordFetcherDelegate { | 28 public TpmPasswordFetcherDelegate { |
| 29 public: | 29 public: |
| 30 explicit EulaScreenHandler(CoreOobeActor* core_oobe_actor); | 30 explicit EulaScreenHandler(CoreOobeActor* core_oobe_actor); |
| 31 virtual ~EulaScreenHandler(); | 31 virtual ~EulaScreenHandler(); |
| 32 | 32 |
| 33 // EulaScreenActor implementation: | 33 // EulaView implementation: |
| 34 virtual void PrepareToShow() override; | 34 virtual void PrepareToShow() override; |
| 35 virtual void Show() override; | 35 virtual void Show() override; |
| 36 virtual void Hide() override; | 36 virtual void Hide() override; |
| 37 virtual void SetDelegate(Delegate* delegate) override; | 37 virtual void SetModel(EulaModel* model) override; |
| 38 virtual void OnPasswordFetched(const std::string& tpm_password) override; | 38 virtual void OnPasswordFetched(const std::string& tpm_password) override; |
| 39 | 39 |
| 40 // BaseScreenHandler implementation: | 40 // BaseScreenHandler implementation: |
| 41 virtual void DeclareLocalizedValues(LocalizedValuesBuilder* builder) override; | 41 virtual void DeclareLocalizedValues(LocalizedValuesBuilder* builder) override; |
| 42 virtual void DeclareJSCallbacks() override; |
| 42 virtual void GetAdditionalParameters(base::DictionaryValue* dict) override; | 43 virtual void GetAdditionalParameters(base::DictionaryValue* dict) override; |
| 43 virtual void Initialize() override; | 44 virtual void Initialize() override; |
| 44 | 45 |
| 45 // WebUIMessageHandler implementation: | |
| 46 virtual void RegisterMessages() override; | |
| 47 | |
| 48 private: | 46 private: |
| 49 // JS messages handlers. | 47 // JS messages handlers. |
| 50 void HandleOnExit(bool accepted, bool usager_stats_enabled); | 48 void HandleAcceptButtonClicked(); |
| 49 void HandleBackButtonClicked(); |
| 51 void HandleOnLearnMore(); | 50 void HandleOnLearnMore(); |
| 52 void HandleOnChromeCredits(); | 51 void HandleOnChromeCredits(); |
| 53 void HandleOnChromeOSCredits(); | 52 void HandleOnChromeOSCredits(); |
| 54 void HandleOnInstallationSettingsPopupOpened(); | 53 void HandleOnInstallationSettingsPopupOpened(); |
| 55 | 54 |
| 56 EulaScreenActor::Delegate* delegate_; | 55 EulaModel* model_; |
| 57 CoreOobeActor* core_oobe_actor_; | 56 CoreOobeActor* core_oobe_actor_; |
| 58 | 57 |
| 59 // Help application used for help dialogs. | 58 // Help application used for help dialogs. |
| 60 scoped_refptr<HelpAppLauncher> help_app_; | 59 scoped_refptr<HelpAppLauncher> help_app_; |
| 61 | 60 |
| 62 // Keeps whether screen should be shown right after initialization. | 61 // Keeps whether screen should be shown right after initialization. |
| 63 bool show_on_init_; | 62 bool show_on_init_; |
| 64 | 63 |
| 65 DISALLOW_COPY_AND_ASSIGN(EulaScreenHandler); | 64 DISALLOW_COPY_AND_ASSIGN(EulaScreenHandler); |
| 66 }; | 65 }; |
| 67 | 66 |
| 68 } // namespace chromeos | 67 } // namespace chromeos |
| 69 | 68 |
| 70 #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 |