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/terms_of_service_screen.h" | 5 #include "chrome/browser/chromeos/login/terms_of_service_screen.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 void TermsOfServiceScreen::OnAccept() { | 75 void TermsOfServiceScreen::OnAccept() { |
76 get_screen_observer()->OnExit(ScreenObserver::TERMS_OF_SERVICE_ACCEPTED); | 76 get_screen_observer()->OnExit(ScreenObserver::TERMS_OF_SERVICE_ACCEPTED); |
77 } | 77 } |
78 | 78 |
79 void TermsOfServiceScreen::OnActorDestroyed(TermsOfServiceScreenActor* actor) { | 79 void TermsOfServiceScreen::OnActorDestroyed(TermsOfServiceScreenActor* actor) { |
80 if (actor_ == actor) | 80 if (actor_ == actor) |
81 actor_ = NULL; | 81 actor_ = NULL; |
82 } | 82 } |
83 | 83 |
84 void TermsOfServiceScreen::StartDownload() { | 84 void TermsOfServiceScreen::StartDownload() { |
85 const PrefService* prefs = ProfileManager::GetDefaultProfile()->GetPrefs(); | 85 const PrefService* prefs = ProfileManager::GetSigninProfile()->GetPrefs(); |
86 // If an URL from which the Terms of Service can be downloaded has not been | 86 // If an URL from which the Terms of Service can be downloaded has not been |
87 // set, show an error message to the user. | 87 // set, show an error message to the user. |
88 std::string terms_of_service_url = | 88 std::string terms_of_service_url = |
89 prefs->GetString(prefs::kTermsOfServiceURL); | 89 prefs->GetString(prefs::kTermsOfServiceURL); |
90 if (terms_of_service_url.empty()) { | 90 if (terms_of_service_url.empty()) { |
91 if (actor_) | 91 if (actor_) |
92 actor_->OnLoadError(); | 92 actor_->OnLoadError(); |
93 return; | 93 return; |
94 } | 94 } |
95 | 95 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 !source->GetResponseAsString(&terms_of_service)) { | 143 !source->GetResponseAsString(&terms_of_service)) { |
144 actor_->OnLoadError(); | 144 actor_->OnLoadError(); |
145 } else { | 145 } else { |
146 // If the Terms of Service were downloaded successfully, show them to the | 146 // If the Terms of Service were downloaded successfully, show them to the |
147 // user. | 147 // user. |
148 actor_->OnLoadSuccess(terms_of_service); | 148 actor_->OnLoadSuccess(terms_of_service); |
149 } | 149 } |
150 } | 150 } |
151 | 151 |
152 } // namespace chromeos | 152 } // namespace chromeos |
OLD | NEW |