| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_SCREENS_TERMS_OF_SERVICE_SCREEN_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_TERMS_OF_SERVICE_SCREEN_VIEW_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_TERMS_OF_SERVICE_SCREEN_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_TERMS_OF_SERVICE_SCREEN_VIEW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include "chrome/browser/chromeos/login/oobe_screen.h" |
| 9 | 10 |
| 10 namespace chromeos { | 11 namespace chromeos { |
| 11 | 12 |
| 12 // Interface for dependency injection between TermsOfServiceScreen and its | 13 // Interface for dependency injection between TermsOfServiceScreen and its |
| 13 // WebUI representation. | 14 // WebUI representation. |
| 14 class TermsOfServiceScreenView { | 15 class TermsOfServiceScreenView { |
| 15 public: | 16 public: |
| 16 class Delegate { | 17 class Delegate { |
| 17 public: | 18 public: |
| 18 virtual ~Delegate() {} | 19 virtual ~Delegate() {} |
| 19 | 20 |
| 20 // Called when the user declines the Terms of Service. | 21 // Called when the user declines the Terms of Service. |
| 21 virtual void OnDecline() = 0; | 22 virtual void OnDecline() = 0; |
| 22 | 23 |
| 23 // Called when the user accepts the Terms of Service. | 24 // Called when the user accepts the Terms of Service. |
| 24 virtual void OnAccept() = 0; | 25 virtual void OnAccept() = 0; |
| 25 | 26 |
| 26 // Called when view is destroyed so there is no dead reference to it. | 27 // Called when view is destroyed so there is no dead reference to it. |
| 27 virtual void OnViewDestroyed(TermsOfServiceScreenView* view) = 0; | 28 virtual void OnViewDestroyed(TermsOfServiceScreenView* view) = 0; |
| 28 }; | 29 }; |
| 29 | 30 |
| 31 constexpr static OobeScreen kScreenId = OobeScreen::SCREEN_TERMS_OF_SERVICE; |
| 32 |
| 30 virtual ~TermsOfServiceScreenView() {} | 33 virtual ~TermsOfServiceScreenView() {} |
| 31 | 34 |
| 32 // Sets screen this view belongs to. | 35 // Sets screen this view belongs to. |
| 33 virtual void SetDelegate(Delegate* screen) = 0; | 36 virtual void SetDelegate(Delegate* screen) = 0; |
| 34 | 37 |
| 35 // Shows the contents of the screen. | 38 // Shows the contents of the screen. |
| 36 virtual void Show() = 0; | 39 virtual void Show() = 0; |
| 37 | 40 |
| 38 // Hides the contents of the screen. | 41 // Hides the contents of the screen. |
| 39 virtual void Hide() = 0; | 42 virtual void Hide() = 0; |
| 40 | 43 |
| 41 // Sets the domain name whose Terms of Service are being shown. | 44 // Sets the domain name whose Terms of Service are being shown. |
| 42 virtual void SetDomain(const std::string& domain) = 0; | 45 virtual void SetDomain(const std::string& domain) = 0; |
| 43 | 46 |
| 44 // Called when the download of the Terms of Service fails. Show an error | 47 // Called when the download of the Terms of Service fails. Show an error |
| 45 // message to the user. | 48 // message to the user. |
| 46 virtual void OnLoadError() = 0; | 49 virtual void OnLoadError() = 0; |
| 47 | 50 |
| 48 // Called when the download of the Terms of Service is successful. Shows the | 51 // Called when the download of the Terms of Service is successful. Shows the |
| 49 // downloaded |terms_of_service| to the user. | 52 // downloaded |terms_of_service| to the user. |
| 50 virtual void OnLoadSuccess(const std::string& terms_of_service) = 0; | 53 virtual void OnLoadSuccess(const std::string& terms_of_service) = 0; |
| 51 }; | 54 }; |
| 52 | 55 |
| 53 } // namespace chromeos | 56 } // namespace chromeos |
| 54 | 57 |
| 55 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_TERMS_OF_SERVICE_SCREEN_VIEW_H_ | 58 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_TERMS_OF_SERVICE_SCREEN_VIEW_H_ |
| OLD | NEW |