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_screen_actor.h"
11 #include "chrome/browser/chromeos/login/tpm_password_fetcher.h"
12 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h"
13 #include "content/public/browser/web_ui.h"
16 class DictionaryValue
;
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 EulaScreenActor
,
27 public BaseScreenHandler
,
28 public TpmPasswordFetcherDelegate
{
30 explicit EulaScreenHandler(CoreOobeActor
* core_oobe_actor
);
31 virtual ~EulaScreenHandler();
33 // EulaScreenActor implementation:
34 virtual void PrepareToShow() OVERRIDE
;
35 virtual void Show() OVERRIDE
;
36 virtual void Hide() OVERRIDE
;
37 virtual void SetDelegate(Delegate
* delegate
) OVERRIDE
;
38 virtual void OnPasswordFetched(const std::string
& tpm_password
) OVERRIDE
;
40 // BaseScreenHandler implementation:
41 virtual void DeclareLocalizedValues(LocalizedValuesBuilder
* builder
) OVERRIDE
;
42 virtual void GetAdditionalParameters(base::DictionaryValue
* dict
) OVERRIDE
;
43 virtual void Initialize() OVERRIDE
;
45 // WebUIMessageHandler implementation:
46 virtual void RegisterMessages() OVERRIDE
;
49 // JS messages handlers.
50 void HandleOnExit(bool accepted
, bool usager_stats_enabled
);
51 void HandleOnLearnMore();
52 void HandleOnInstallationSettingsPopupOpened();
54 EulaScreenActor::Delegate
* delegate_
;
55 CoreOobeActor
* core_oobe_actor_
;
57 // Help application used for help dialogs.
58 scoped_refptr
<HelpAppLauncher
> help_app_
;
60 // Keeps whether screen should be shown right after initialization.
63 DISALLOW_COPY_AND_ASSIGN(EulaScreenHandler
);
66 } // namespace chromeos
68 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_EULA_SCREEN_HANDLER_H_