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 #include "chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler
.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler
.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
13 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
16 #include "chrome/browser/chromeos/base/locale_util.h" | 16 #include "chrome/browser/chromeos/base/locale_util.h" |
17 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" | 17 #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h" |
18 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 18 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
20 #include "chrome/browser/profiles/profile_manager.h" | 20 #include "chrome/browser/profiles/profile_manager.h" |
21 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 21 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
22 #include "chrome/common/pref_names.h" | 22 #include "chrome/common/pref_names.h" |
23 #include "chrome/grit/chromium_strings.h" | 23 #include "chrome/grit/chromium_strings.h" |
24 #include "chrome/grit/generated_resources.h" | 24 #include "chrome/grit/generated_resources.h" |
| 25 #include "components/login/localized_values_builder.h" |
25 #include "components/user_manager/user.h" | 26 #include "components/user_manager/user.h" |
26 #include "components/user_manager/user_manager.h" | 27 #include "components/user_manager/user_manager.h" |
27 #include "content/public/browser/web_ui.h" | 28 #include "content/public/browser/web_ui.h" |
28 #include "ui/base/ime/chromeos/input_method_manager.h" | 29 #include "ui/base/ime/chromeos/input_method_manager.h" |
29 | 30 |
30 namespace { | 31 namespace { |
31 | 32 |
32 const char kJsScreenPath[] = "login.TermsOfServiceScreen"; | 33 const char kJsScreenPath[] = "login.TermsOfServiceScreen"; |
33 | 34 |
34 } // namespace | 35 } // namespace |
(...skipping 15 matching lines...) Expand all Loading... |
50 } | 51 } |
51 | 52 |
52 void TermsOfServiceScreenHandler::RegisterMessages() { | 53 void TermsOfServiceScreenHandler::RegisterMessages() { |
53 AddCallback("termsOfServiceBack", | 54 AddCallback("termsOfServiceBack", |
54 &TermsOfServiceScreenHandler::HandleBack); | 55 &TermsOfServiceScreenHandler::HandleBack); |
55 AddCallback("termsOfServiceAccept", | 56 AddCallback("termsOfServiceAccept", |
56 &TermsOfServiceScreenHandler::HandleAccept); | 57 &TermsOfServiceScreenHandler::HandleAccept); |
57 } | 58 } |
58 | 59 |
59 void TermsOfServiceScreenHandler::DeclareLocalizedValues( | 60 void TermsOfServiceScreenHandler::DeclareLocalizedValues( |
60 LocalizedValuesBuilder* builder) { | 61 ::login::LocalizedValuesBuilder* builder) { |
61 builder->Add("termsOfServiceScreenHeading", | 62 builder->Add("termsOfServiceScreenHeading", |
62 IDS_TERMS_OF_SERVICE_SCREEN_HEADING); | 63 IDS_TERMS_OF_SERVICE_SCREEN_HEADING); |
63 builder->Add("termsOfServiceScreenSubheading", | 64 builder->Add("termsOfServiceScreenSubheading", |
64 IDS_TERMS_OF_SERVICE_SCREEN_SUBHEADING); | 65 IDS_TERMS_OF_SERVICE_SCREEN_SUBHEADING); |
65 builder->Add("termsOfServiceContentHeading", | 66 builder->Add("termsOfServiceContentHeading", |
66 IDS_TERMS_OF_SERVICE_SCREEN_CONTENT_HEADING); | 67 IDS_TERMS_OF_SERVICE_SCREEN_CONTENT_HEADING); |
67 builder->Add("termsOfServiceLoading", IDS_TERMS_OF_SERVICE_SCREEN_LOADING); | 68 builder->Add("termsOfServiceLoading", IDS_TERMS_OF_SERVICE_SCREEN_LOADING); |
68 builder->Add("termsOfServiceError", IDS_TERMS_OF_SERVICE_SCREEN_ERROR); | 69 builder->Add("termsOfServiceError", IDS_TERMS_OF_SERVICE_SCREEN_ERROR); |
69 builder->Add("termsOfServiceTryAgain", IDS_TERMS_OF_SERVICE_SCREEN_TRY_AGAIN); | 70 builder->Add("termsOfServiceTryAgain", IDS_TERMS_OF_SERVICE_SCREEN_TRY_AGAIN); |
70 builder->Add("termsOfServiceBackButton", | 71 builder->Add("termsOfServiceBackButton", |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 // and continue" button should not be accessible. If the user managed to | 210 // and continue" button should not be accessible. If the user managed to |
210 // activate it somehow anway, do not treat this as acceptance of the Terms | 211 // activate it somehow anway, do not treat this as acceptance of the Terms |
211 // and Conditions and end the session instead, as if the user had declined. | 212 // and Conditions and end the session instead, as if the user had declined. |
212 if (terms_of_service_.empty()) | 213 if (terms_of_service_.empty()) |
213 screen_->OnDecline(); | 214 screen_->OnDecline(); |
214 else | 215 else |
215 screen_->OnAccept(); | 216 screen_->OnAccept(); |
216 } | 217 } |
217 | 218 |
218 } // namespace chromeos | 219 } // namespace chromeos |
OLD | NEW |