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/base_screen.h"
12 #include "chrome/browser/chromeos/login/screens/eula_model.h"
13 #include "chromeos/tpm/tpm_password_fetcher.h"
14 #include "components/login/screens/screen_context.h"
19 // Representation independent class that controls OOBE screen showing EULA
21 class EulaScreen
: public EulaModel
, public TpmPasswordFetcherDelegate
{
25 virtual ~Delegate() {}
27 // Whether usage statistics reporting is enabled on EULA screen.
28 virtual void SetUsageStatisticsReporting(bool val
) = 0;
29 virtual bool GetUsageStatisticsReporting() const = 0;
32 EulaScreen(BaseScreenDelegate
* base_screen_delegate
,
35 ~EulaScreen() override
;
37 // EulaModel implementation:
38 void PrepareToShow() override
;
41 GURL
GetOemEulaUrl() const override
;
42 void InitiatePasswordFetch() override
;
43 bool IsUsageStatsEnabled() const override
;
44 void OnViewDestroyed(EulaView
* view
) override
;
45 void OnUserAction(const std::string
& action_id
) override
;
46 void OnContextKeyUpdated(const ::login::ScreenContext::KeyType
& key
) override
;
48 // TpmPasswordFetcherDelegate implementation:
49 void OnPasswordFetched(const std::string
& tpm_password
) override
;
52 // URL of the OEM EULA page (on disk).
55 // TPM password local storage. By convention, we clear the password
56 // from TPM as soon as we read it. We store it here locally until
57 // EULA screen is closed.
58 // TODO(glotov): Sanitize memory used to store password when
60 std::string tpm_password_
;
66 TpmPasswordFetcher password_fetcher_
;
68 DISALLOW_COPY_AND_ASSIGN(EulaScreen
);
71 } // namespace chromeos
73 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_EULA_SCREEN_H_