| 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 "base/values.h" | 7 #include "base/values.h" |
| 8 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 8 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 9 #include "grit/chromium_strings.h" | 9 #include "grit/chromium_strings.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // OnLoadError() or the OnLoadSuccess() callback is called. | 111 // OnLoadError() or the OnLoadSuccess() callback is called. |
| 112 if (load_error_) { | 112 if (load_error_) { |
| 113 web_ui()->CallJavascriptFunction("cr.ui.Oobe.setTermsOfServiceLoadError"); | 113 web_ui()->CallJavascriptFunction("cr.ui.Oobe.setTermsOfServiceLoadError"); |
| 114 } else if (!terms_of_service_.empty()) { | 114 } else if (!terms_of_service_.empty()) { |
| 115 base::StringValue terms_of_service(terms_of_service_); | 115 base::StringValue terms_of_service(terms_of_service_); |
| 116 web_ui()->CallJavascriptFunction("cr.ui.Oobe.setTermsOfService", | 116 web_ui()->CallJavascriptFunction("cr.ui.Oobe.setTermsOfService", |
| 117 terms_of_service); | 117 terms_of_service); |
| 118 } | 118 } |
| 119 } | 119 } |
| 120 | 120 |
| 121 void TermsOfServiceScreenHandler::HandleBack(const base::ListValue* args) { | 121 void TermsOfServiceScreenHandler::HandleBack() { |
| 122 if (screen_) | 122 if (screen_) |
| 123 screen_->OnDecline(); | 123 screen_->OnDecline(); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void TermsOfServiceScreenHandler::HandleAccept(const base::ListValue* args) { | 126 void TermsOfServiceScreenHandler::HandleAccept() { |
| 127 if (!screen_) | 127 if (!screen_) |
| 128 return; | 128 return; |
| 129 | 129 |
| 130 // If the Terms of Service have not been successfully downloaded, the "accept | 130 // If the Terms of Service have not been successfully downloaded, the "accept |
| 131 // and continue" button should not be accessible. If the user managed to | 131 // and continue" button should not be accessible. If the user managed to |
| 132 // activate it somehow anway, do not treat this as acceptance of the Terms | 132 // activate it somehow anway, do not treat this as acceptance of the Terms |
| 133 // and Conditions and end the session instead, as if the user had declined. | 133 // and Conditions and end the session instead, as if the user had declined. |
| 134 if (terms_of_service_.empty()) | 134 if (terms_of_service_.empty()) |
| 135 screen_->OnDecline(); | 135 screen_->OnDecline(); |
| 136 else | 136 else |
| 137 screen_->OnAccept(); | 137 screen_->OnAccept(); |
| 138 } | 138 } |
| 139 | 139 |
| 140 } // namespace chromeos | 140 } // namespace chromeos |
| OLD | NEW |