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_CHROMEOS_LOGIN_SCREENS_EULA_SCREEN_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_EULA_SCREEN_H_
10 #include "base/compiler_specific.h"
11 #include "chrome/browser/chromeos/login/screens/eula_screen_actor.h"
12 #include "chrome/browser/chromeos/login/screens/wizard_screen.h"
13 #include "chrome/browser/chromeos/login/tpm_password_fetcher.h"
18 // Representation independent class that controls OOBE screen showing EULA
20 class EulaScreen
: public WizardScreen
,
21 public EulaScreenActor::Delegate
,
22 public TpmPasswordFetcherDelegate
{
24 EulaScreen(ScreenObserver
* observer
, EulaScreenActor
* actor
);
25 virtual ~EulaScreen();
27 // WizardScreen implementation:
28 virtual void PrepareToShow() OVERRIDE
;
29 virtual void Show() OVERRIDE
;
30 virtual void Hide() OVERRIDE
;
31 virtual std::string
GetName() const OVERRIDE
;
33 // EulaScreenActor::Delegate implementation:
34 virtual GURL
GetOemEulaUrl() const OVERRIDE
;
35 virtual void OnExit(bool accepted
, bool usage_stats_enabled
) OVERRIDE
;
36 virtual void InitiatePasswordFetch() OVERRIDE
;
37 virtual bool IsUsageStatsEnabled() const OVERRIDE
;
38 virtual void OnActorDestroyed(EulaScreenActor
* actor
) OVERRIDE
;
40 // TpmPasswordFetcherDelegate implementation:
41 virtual void OnPasswordFetched(const std::string
& tpm_password
) OVERRIDE
;
44 // URL of the OEM EULA page (on disk).
47 // TPM password local storage. By convention, we clear the password
48 // from TPM as soon as we read it. We store it here locally until
49 // EULA screen is closed.
50 // TODO(glotov): Sanitize memory used to store password when
52 std::string tpm_password_
;
54 EulaScreenActor
* actor_
;
56 TpmPasswordFetcher password_fetcher_
;
58 DISALLOW_COPY_AND_ASSIGN(EulaScreen
);
61 } // namespace chromeos
63 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_EULA_SCREEN_H_