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_CHROMEOS_LOGIN_EULA_SCREEN_ACTOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_EULA_SCREEN_ACTOR_H_ |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EULA_SCREEN_ACTOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_EULA_SCREEN_ACTOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
11 #include "ui/gfx/size.h" | 11 #include "ui/gfx/size.h" |
12 | 12 |
13 namespace chromeos { | 13 namespace chromeos { |
14 | 14 |
15 // Interface between eula screen and its representation, either WebUI or | 15 // Interface between eula screen and its representation, either WebUI or |
16 // Views one. Note, do not forget to call OnActorDestroyed in the dtor. | 16 // Views one. Note, do not forget to call OnActorDestroyed in the dtor. |
17 class EulaScreenActor { | 17 class EulaScreenActor { |
18 public: | 18 public: |
19 // Allows us to get info from eula screen that we need. | 19 // Allows us to get info from eula screen that we need. |
20 class Delegate { | 20 class Delegate { |
21 public: | 21 public: |
22 virtual ~Delegate() {} | 22 virtual ~Delegate() {} |
23 | 23 |
24 // Returns URL of the OEM EULA page that should be displayed using current | 24 // Returns URL of the OEM EULA page that should be displayed using current |
25 // locale and manifest. Returns empty URL otherwise. | 25 // locale and manifest. Returns empty URL otherwise. |
26 virtual GURL GetOemEulaUrl() const = 0; | 26 virtual GURL GetOemEulaUrl() const = 0; |
27 | 27 |
28 // Called when screen is exited. |accepted| indicates if EULA was | 28 // Called when screen is exited. |accepted| indicates if EULA was |
29 // accepted or not. | 29 // accepted or not. |
30 virtual void OnExit(bool accepted, bool is_usage_stats_checked) = 0; | 30 virtual void OnExit(bool accepted, |
| 31 bool usage_stats_enabled, |
| 32 bool rlz_enabled) = 0; |
31 | 33 |
32 // Initiate TPM password fetch. Will call actor's OnPasswordFetched() when | 34 // Initiate TPM password fetch. Will call actor's OnPasswordFetched() when |
33 // done. | 35 // done. |
34 virtual void InitiatePasswordFetch() = 0; | 36 virtual void InitiatePasswordFetch() = 0; |
35 | 37 |
36 // Returns true if usage statistics reporting is enabled. | 38 // Returns true if usage statistics reporting is enabled. |
37 virtual bool IsUsageStatsEnabled() const = 0; | 39 virtual bool IsUsageStatsEnabled() const = 0; |
38 | 40 |
39 // This method is called, when actor is being destroyed. Note, if Delegate | 41 // This method is called, when actor is being destroyed. Note, if Delegate |
40 // is destroyed earlier then it has to call SetDelegate(NULL). | 42 // is destroyed earlier then it has to call SetDelegate(NULL). |
41 virtual void OnActorDestroyed(EulaScreenActor* actor) = 0; | 43 virtual void OnActorDestroyed(EulaScreenActor* actor) = 0; |
42 }; | 44 }; |
43 | 45 |
44 virtual ~EulaScreenActor() {} | 46 virtual ~EulaScreenActor() {} |
45 | 47 |
46 virtual void PrepareToShow() = 0; | 48 virtual void PrepareToShow() = 0; |
47 virtual void Show() = 0; | 49 virtual void Show() = 0; |
48 virtual void Hide() = 0; | 50 virtual void Hide() = 0; |
49 virtual void SetDelegate(Delegate* delegate) = 0; | 51 virtual void SetDelegate(Delegate* delegate) = 0; |
50 virtual void OnPasswordFetched(const std::string& tpm_password) = 0; | 52 virtual void OnPasswordFetched(const std::string& tpm_password) = 0; |
51 }; | 53 }; |
52 | 54 |
53 } // namespace chromeos | 55 } // namespace chromeos |
54 | 56 |
55 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EULA_SCREEN_ACTOR_H_ | 57 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EULA_SCREEN_ACTOR_H_ |
OLD | NEW |