Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / chromeos / login / screens / terms_of_service_screen_actor.h
blobb52b3268a290ef4d58b21eb371b45ee99388ae7c
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_TERMS_OF_SERVICE_SCREEN_ACTOR_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_TERMS_OF_SERVICE_SCREEN_ACTOR_H_
8 #include <string>
10 namespace chromeos {
12 // Interface for dependency injection between TermsOfServiceScreen and its
13 // WebUI representation.
14 class TermsOfServiceScreenActor {
15 public:
16 class Delegate {
17 public:
18 virtual ~Delegate() {}
20 // Called when the user declines the Terms of Service.
21 virtual void OnDecline() = 0;
23 // Called when the user accepts the Terms of Service.
24 virtual void OnAccept() = 0;
26 // Called when actor is destroyed so there is no dead reference to it.
27 virtual void OnActorDestroyed(TermsOfServiceScreenActor* actor) = 0;
30 virtual ~TermsOfServiceScreenActor() {}
32 // Sets screen this actor belongs to.
33 virtual void SetDelegate(Delegate* screen) = 0;
35 // Shows the contents of the screen.
36 virtual void Show() = 0;
38 // Hides the contents of the screen.
39 virtual void Hide() = 0;
41 // Sets the domain name whose Terms of Service are being shown.
42 virtual void SetDomain(const std::string& domain) = 0;
44 // Called when the download of the Terms of Service fails. Show an error
45 // message to the user.
46 virtual void OnLoadError() = 0;
48 // Called when the download of the Terms of Service is successful. Shows the
49 // downloaded |terms_of_service| to the user.
50 virtual void OnLoadSuccess(const std::string& terms_of_service) = 0;
53 } // namespace chromeos
55 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_TERMS_OF_SERVICE_SCREEN_ACTOR_H_