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_UI_WEBUI_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_HANDLER_H
_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_HANDLER_H
_ |
6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_HANDLER_H
_ | 6 #define CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_HANDLER_H
_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "chrome/browser/chromeos/base/locale_util.h" |
12 #include "chrome/browser/chromeos/login/screens/terms_of_service_screen_actor.h" | 13 #include "chrome/browser/chromeos/login/screens/terms_of_service_screen_actor.h" |
13 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" | 14 #include "chrome/browser/ui/webui/chromeos/login/base_screen_handler.h" |
14 | 15 |
15 namespace chromeos { | 16 namespace chromeos { |
16 | 17 |
17 class CoreOobeActor; | 18 class CoreOobeActor; |
18 | 19 |
19 // The sole implementation of the TermsOfServiceScreenActor, using WebUI. | 20 // The sole implementation of the TermsOfServiceScreenActor, using WebUI. |
20 class TermsOfServiceScreenHandler : public BaseScreenHandler, | 21 class TermsOfServiceScreenHandler : public BaseScreenHandler, |
21 public TermsOfServiceScreenActor { | 22 public TermsOfServiceScreenActor { |
(...skipping 13 matching lines...) Expand all Loading... |
35 virtual void Hide() override; | 36 virtual void Hide() override; |
36 virtual void SetDomain(const std::string& domain) override; | 37 virtual void SetDomain(const std::string& domain) override; |
37 virtual void OnLoadError() override; | 38 virtual void OnLoadError() override; |
38 virtual void OnLoadSuccess(const std::string& terms_of_service) override; | 39 virtual void OnLoadSuccess(const std::string& terms_of_service) override; |
39 | 40 |
40 private: | 41 private: |
41 // BaseScreenHandler: | 42 // BaseScreenHandler: |
42 virtual void Initialize() override; | 43 virtual void Initialize() override; |
43 | 44 |
44 // Callback invoked after the UI locale has been changed. | 45 // Callback invoked after the UI locale has been changed. |
45 void OnLanguageChangedCallback(const std::string& requested_locale, | 46 void OnLanguageChangedCallback( |
46 const std::string& loaded_locale, | 47 const locale_util::LanguageSwitchResult& result); |
47 const bool success); | |
48 | 48 |
49 // Switch to the user's preferred input method and show the screen. This | 49 // Switch to the user's preferred input method and show the screen. This |
50 // method is called after it has been ensured that the current UI locale | 50 // method is called after it has been ensured that the current UI locale |
51 // matches the UI locale chosen by the user. | 51 // matches the UI locale chosen by the user. |
52 void DoShow(); | 52 void DoShow(); |
53 | 53 |
54 // Update the domain name shown in the UI. | 54 // Update the domain name shown in the UI. |
55 void UpdateDomainInUI(); | 55 void UpdateDomainInUI(); |
56 | 56 |
57 // Update the UI to show an error message or the Terms of Service, depending | 57 // Update the UI to show an error message or the Terms of Service, depending |
(...skipping 24 matching lines...) Expand all Loading... |
82 | 82 |
83 // Set to the Terms of Service when the download is successful. | 83 // Set to the Terms of Service when the download is successful. |
84 std::string terms_of_service_; | 84 std::string terms_of_service_; |
85 | 85 |
86 DISALLOW_COPY_AND_ASSIGN(TermsOfServiceScreenHandler); | 86 DISALLOW_COPY_AND_ASSIGN(TermsOfServiceScreenHandler); |
87 }; | 87 }; |
88 | 88 |
89 } // namespace chromeos | 89 } // namespace chromeos |
90 | 90 |
91 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_HANDLE
R_H_ | 91 #endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_LOGIN_TERMS_OF_SERVICE_SCREEN_HANDLE
R_H_ |
OLD | NEW |