| 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/chromeos/login/screens/terms_of_service_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/terms_of_service_screen.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "net/url_request/url_fetcher.h" | 22 #include "net/url_request/url_fetcher.h" |
| 23 #include "net/url_request/url_request_context_getter.h" | 23 #include "net/url_request/url_request_context_getter.h" |
| 24 #include "net/url_request/url_request_status.h" | 24 #include "net/url_request/url_request_status.h" |
| 25 #include "url/gurl.h" | 25 #include "url/gurl.h" |
| 26 | 26 |
| 27 namespace chromeos { | 27 namespace chromeos { |
| 28 | 28 |
| 29 TermsOfServiceScreen::TermsOfServiceScreen( | 29 TermsOfServiceScreen::TermsOfServiceScreen( |
| 30 BaseScreenDelegate* base_screen_delegate, | 30 BaseScreenDelegate* base_screen_delegate, |
| 31 TermsOfServiceScreenActor* actor) | 31 TermsOfServiceScreenActor* actor) |
| 32 : BaseScreen(base_screen_delegate), actor_(actor) { | 32 : BaseScreen(base_screen_delegate, |
| 33 WizardController::kTermsOfServiceScreenName), |
| 34 actor_(actor) { |
| 33 DCHECK(actor_); | 35 DCHECK(actor_); |
| 34 if (actor_) | 36 if (actor_) |
| 35 actor_->SetDelegate(this); | 37 actor_->SetDelegate(this); |
| 36 } | 38 } |
| 37 | 39 |
| 38 TermsOfServiceScreen::~TermsOfServiceScreen() { | 40 TermsOfServiceScreen::~TermsOfServiceScreen() { |
| 39 if (actor_) | 41 if (actor_) |
| 40 actor_->SetDelegate(NULL); | 42 actor_->SetDelegate(NULL); |
| 41 } | 43 } |
| 42 | 44 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 54 | 56 |
| 55 // Start downloading the Terms of Service. | 57 // Start downloading the Terms of Service. |
| 56 StartDownload(); | 58 StartDownload(); |
| 57 } | 59 } |
| 58 | 60 |
| 59 void TermsOfServiceScreen::Hide() { | 61 void TermsOfServiceScreen::Hide() { |
| 60 if (actor_) | 62 if (actor_) |
| 61 actor_->Hide(); | 63 actor_->Hide(); |
| 62 } | 64 } |
| 63 | 65 |
| 64 std::string TermsOfServiceScreen::GetName() const { | |
| 65 return WizardController::kTermsOfServiceScreenName; | |
| 66 } | |
| 67 | |
| 68 void TermsOfServiceScreen::OnDecline() { | 66 void TermsOfServiceScreen::OnDecline() { |
| 69 Finish(BaseScreenDelegate::TERMS_OF_SERVICE_DECLINED); | 67 Finish(BaseScreenDelegate::TERMS_OF_SERVICE_DECLINED); |
| 70 } | 68 } |
| 71 | 69 |
| 72 void TermsOfServiceScreen::OnAccept() { | 70 void TermsOfServiceScreen::OnAccept() { |
| 73 Finish(BaseScreenDelegate::TERMS_OF_SERVICE_ACCEPTED); | 71 Finish(BaseScreenDelegate::TERMS_OF_SERVICE_ACCEPTED); |
| 74 } | 72 } |
| 75 | 73 |
| 76 void TermsOfServiceScreen::OnActorDestroyed(TermsOfServiceScreenActor* actor) { | 74 void TermsOfServiceScreen::OnActorDestroyed(TermsOfServiceScreenActor* actor) { |
| 77 if (actor_ == actor) | 75 if (actor_ == actor) |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 !source->GetResponseAsString(&terms_of_service)) { | 139 !source->GetResponseAsString(&terms_of_service)) { |
| 142 actor_->OnLoadError(); | 140 actor_->OnLoadError(); |
| 143 } else { | 141 } else { |
| 144 // If the Terms of Service were downloaded successfully, show them to the | 142 // If the Terms of Service were downloaded successfully, show them to the |
| 145 // user. | 143 // user. |
| 146 actor_->OnLoadSuccess(terms_of_service); | 144 actor_->OnLoadSuccess(terms_of_service); |
| 147 } | 145 } |
| 148 } | 146 } |
| 149 | 147 |
| 150 } // namespace chromeos | 148 } // namespace chromeos |
| OLD | NEW |