Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(619)

Side by Side Diff: chrome/browser/ui/webui/chromeos/login/terms_of_service_screen_handler.cc

Issue 2713513009: cros: Break BaseScreenHandler into two classes. (Closed)
Patch Set: Add comments, fix compile Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 20 matching lines...) Expand all
31 namespace { 31 namespace {
32 32
33 const char kJsScreenPath[] = "login.TermsOfServiceScreen"; 33 const char kJsScreenPath[] = "login.TermsOfServiceScreen";
34 34
35 } // namespace 35 } // namespace
36 36
37 namespace chromeos { 37 namespace chromeos {
38 38
39 TermsOfServiceScreenHandler::TermsOfServiceScreenHandler( 39 TermsOfServiceScreenHandler::TermsOfServiceScreenHandler(
40 CoreOobeView* core_oobe_view) 40 CoreOobeView* core_oobe_view)
41 : core_oobe_view_(core_oobe_view) { 41 : BaseScreenHandler(kScreenId), core_oobe_view_(core_oobe_view) {
42 set_call_js_prefix(kJsScreenPath); 42 set_call_js_prefix(kJsScreenPath);
43 } 43 }
44 44
45 TermsOfServiceScreenHandler::~TermsOfServiceScreenHandler() { 45 TermsOfServiceScreenHandler::~TermsOfServiceScreenHandler() {
46 if (screen_) 46 if (screen_)
47 screen_->OnViewDestroyed(this); 47 screen_->OnViewDestroyed(this);
48 } 48 }
49 49
50 void TermsOfServiceScreenHandler::RegisterMessages() { 50 void TermsOfServiceScreenHandler::RegisterMessages() {
51 AddCallback("termsOfServiceBack", 51 AddCallback("termsOfServiceBack",
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 input_method_manager->GetActiveIMEState()->ChangeInputMethod( 162 input_method_manager->GetActiveIMEState()->ChangeInputMethod(
163 input_methods.front(), false /* show_message */); 163 input_methods.front(), false /* show_message */);
164 } 164 }
165 165
166 // Updates the domain name shown in the UI. 166 // Updates the domain name shown in the UI.
167 UpdateDomainInUI(); 167 UpdateDomainInUI();
168 168
169 // Update the UI to show an error message or the Terms of Service. 169 // Update the UI to show an error message or the Terms of Service.
170 UpdateTermsOfServiceInUI(); 170 UpdateTermsOfServiceInUI();
171 171
172 ShowScreen(OobeScreen::SCREEN_TERMS_OF_SERVICE); 172 ShowScreen(kScreenId);
173 } 173 }
174 174
175 void TermsOfServiceScreenHandler::UpdateDomainInUI() { 175 void TermsOfServiceScreenHandler::UpdateDomainInUI() {
176 if (page_is_ready()) 176 if (page_is_ready())
177 CallJS("setDomain", domain_); 177 CallJS("setDomain", domain_);
178 } 178 }
179 179
180 void TermsOfServiceScreenHandler::UpdateTermsOfServiceInUI() { 180 void TermsOfServiceScreenHandler::UpdateTermsOfServiceInUI() {
181 if (!page_is_ready()) 181 if (!page_is_ready())
182 return; 182 return;
(...skipping 21 matching lines...) Expand all
204 // and continue" button should not be accessible. If the user managed to 204 // and continue" button should not be accessible. If the user managed to
205 // activate it somehow anway, do not treat this as acceptance of the Terms 205 // activate it somehow anway, do not treat this as acceptance of the Terms
206 // and Conditions and end the session instead, as if the user had declined. 206 // and Conditions and end the session instead, as if the user had declined.
207 if (terms_of_service_.empty()) 207 if (terms_of_service_.empty())
208 screen_->OnDecline(); 208 screen_->OnDecline();
209 else 209 else
210 screen_->OnAccept(); 210 screen_->OnAccept();
211 } 211 }
212 212
213 } // namespace chromeos 213 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698