Update broken references to image assets
[chromium-blink-merge.git] / chrome / browser / chromeos / login / screens / terms_of_service_screen.h
blob8d19eb803bc17d8198ff1e037ada847e45c62730
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_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_TERMS_OF_SERVICE_SCREEN_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/timer/timer.h"
12 #include "chrome/browser/chromeos/login/screens/base_screen.h"
13 #include "chrome/browser/chromeos/login/screens/terms_of_service_screen_actor.h"
14 #include "net/url_request/url_fetcher_delegate.h"
16 namespace net {
17 class URLFetcher;
20 namespace chromeos {
22 class BaseScreenDelegate;
24 // A screen that shows Terms of Service which have been configured through
25 // policy. The screen is shown during login and requires the user to accept the
26 // Terms of Service before proceeding. Currently, Terms of Service are available
27 // for public sessions only.
28 class TermsOfServiceScreen : public BaseScreen,
29 public TermsOfServiceScreenActor::Delegate,
30 public net::URLFetcherDelegate {
31 public:
32 TermsOfServiceScreen(BaseScreenDelegate* base_screen_delegate,
33 TermsOfServiceScreenActor* actor);
34 ~TermsOfServiceScreen() override;
36 // BaseScreen:
37 void PrepareToShow() override;
38 void Show() override;
39 void Hide() override;
40 std::string GetName() const override;
42 // TermsOfServiceScreenActor::Delegate:
43 void OnDecline() override;
44 void OnAccept() override;
45 void OnActorDestroyed(TermsOfServiceScreenActor* actor) override;
47 private:
48 // Start downloading the Terms of Service.
49 void StartDownload();
51 // Abort the attempt to download the Terms of Service if it takes too long.
52 void OnDownloadTimeout();
54 // net::URLFetcherDelegate:
55 void OnURLFetchComplete(const net::URLFetcher* source) override;
57 TermsOfServiceScreenActor* actor_;
59 scoped_ptr<net::URLFetcher> terms_of_service_fetcher_;
61 // Timer that enforces a custom (shorter) timeout on the attempt to download
62 // the Terms of Service.
63 base::OneShotTimer<TermsOfServiceScreen> download_timer_;
65 DISALLOW_COPY_AND_ASSIGN(TermsOfServiceScreen);
68 } // namespace chromeos
70 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_TERMS_OF_SERVICE_SCREEN_H_