| 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, | 30 virtual void OnExit(bool accepted, bool usage_stats_enabled) = 0; |
| 31 bool usage_stats_enabled, | |
| 32 bool rlz_enabled) = 0; | |
| 33 | 31 |
| 34 // Initiate TPM password fetch. Will call actor's OnPasswordFetched() when | 32 // Initiate TPM password fetch. Will call actor's OnPasswordFetched() when |
| 35 // done. | 33 // done. |
| 36 virtual void InitiatePasswordFetch() = 0; | 34 virtual void InitiatePasswordFetch() = 0; |
| 37 | 35 |
| 38 // Returns true if usage statistics reporting is enabled. | 36 // Returns true if usage statistics reporting is enabled. |
| 39 virtual bool IsUsageStatsEnabled() const = 0; | 37 virtual bool IsUsageStatsEnabled() const = 0; |
| 40 | 38 |
| 41 // This method is called, when actor is being destroyed. Note, if Delegate | 39 // This method is called, when actor is being destroyed. Note, if Delegate |
| 42 // is destroyed earlier then it has to call SetDelegate(NULL). | 40 // is destroyed earlier then it has to call SetDelegate(NULL). |
| 43 virtual void OnActorDestroyed(EulaScreenActor* actor) = 0; | 41 virtual void OnActorDestroyed(EulaScreenActor* actor) = 0; |
| 44 }; | 42 }; |
| 45 | 43 |
| 46 virtual ~EulaScreenActor() {} | 44 virtual ~EulaScreenActor() {} |
| 47 | 45 |
| 48 virtual void PrepareToShow() = 0; | 46 virtual void PrepareToShow() = 0; |
| 49 virtual void Show() = 0; | 47 virtual void Show() = 0; |
| 50 virtual void Hide() = 0; | 48 virtual void Hide() = 0; |
| 51 virtual void SetDelegate(Delegate* delegate) = 0; | 49 virtual void SetDelegate(Delegate* delegate) = 0; |
| 52 virtual void OnPasswordFetched(const std::string& tpm_password) = 0; | 50 virtual void OnPasswordFetched(const std::string& tpm_password) = 0; |
| 53 }; | 51 }; |
| 54 | 52 |
| 55 } // namespace chromeos | 53 } // namespace chromeos |
| 56 | 54 |
| 57 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EULA_SCREEN_ACTOR_H_ | 55 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_EULA_SCREEN_ACTOR_H_ |
| OLD | NEW |