Update broken references to image assets
[chromium-blink-merge.git] / chrome / browser / chromeos / login / screens / eula_screen.h
blobdd0df245ac5ffa9c69e704b61e7d4708141ea9c2
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_
8 #include <string>
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"
15 #include "url/gurl.h"
17 namespace chromeos {
19 // Representation independent class that controls OOBE screen showing EULA
20 // to users.
21 class EulaScreen : public EulaModel, public TpmPasswordFetcherDelegate {
22 public:
23 class Delegate {
24 public:
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,
33 Delegate* delegate,
34 EulaView* view);
35 ~EulaScreen() override;
37 // EulaModel implementation:
38 void PrepareToShow() override;
39 void Show() override;
40 void Hide() 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;
51 private:
52 // URL of the OEM EULA page (on disk).
53 GURL oem_eula_page_;
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
59 // it's destroyed.
60 std::string tpm_password_;
62 Delegate* delegate_;
64 EulaView* view_;
66 TpmPasswordFetcher password_fetcher_;
68 DISALLOW_COPY_AND_ASSIGN(EulaScreen);
71 } // namespace chromeos
73 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_EULA_SCREEN_H_