| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/supervised_user/supervised_user_interstitial.h" | 5 #include "chrome/browser/supervised_user/supervised_user_interstitial.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 189 |
| 190 // static | 190 // static |
| 191 std::string SupervisedUserInterstitial::GetHTMLContents( | 191 std::string SupervisedUserInterstitial::GetHTMLContents( |
| 192 Profile* profile, | 192 Profile* profile, |
| 193 supervised_user_error_page::FilteringBehaviorReason reason) { | 193 supervised_user_error_page::FilteringBehaviorReason reason) { |
| 194 bool is_child_account = profile->IsChild(); | 194 bool is_child_account = profile->IsChild(); |
| 195 | 195 |
| 196 SupervisedUserService* supervised_user_service = | 196 SupervisedUserService* supervised_user_service = |
| 197 SupervisedUserServiceFactory::GetForProfile(profile); | 197 SupervisedUserServiceFactory::GetForProfile(profile); |
| 198 | 198 |
| 199 base::string16 custodian = | 199 std::string custodian = supervised_user_service->GetCustodianName(); |
| 200 base::UTF8ToUTF16(supervised_user_service->GetCustodianName()); | 200 std::string second_custodian = |
| 201 base::string16 second_custodian = | 201 supervised_user_service->GetSecondCustodianName(); |
| 202 base::UTF8ToUTF16(supervised_user_service->GetSecondCustodianName()); | 202 std::string custodian_email = |
| 203 base::string16 custodian_email = | 203 supervised_user_service->GetCustodianEmailAddress(); |
| 204 base::UTF8ToUTF16(supervised_user_service->GetCustodianEmailAddress()); | 204 std::string second_custodian_email = |
| 205 base::string16 second_custodian_email = base::UTF8ToUTF16( | 205 supervised_user_service->GetSecondCustodianEmailAddress(); |
| 206 supervised_user_service->GetSecondCustodianEmailAddress()); | |
| 207 std::string profile_image_url = profile->GetPrefs()->GetString( | 206 std::string profile_image_url = profile->GetPrefs()->GetString( |
| 208 prefs::kSupervisedUserCustodianProfileImageURL); | 207 prefs::kSupervisedUserCustodianProfileImageURL); |
| 209 std::string profile_image_url2 = profile->GetPrefs()->GetString( | 208 std::string profile_image_url2 = profile->GetPrefs()->GetString( |
| 210 prefs::kSupervisedUserSecondCustodianProfileImageURL); | 209 prefs::kSupervisedUserSecondCustodianProfileImageURL); |
| 211 | 210 |
| 212 bool allow_access_requests = supervised_user_service->AccessRequestsEnabled(); | 211 bool allow_access_requests = supervised_user_service->AccessRequestsEnabled(); |
| 213 | 212 |
| 214 return supervised_user_error_page::BuildHtml( | 213 return supervised_user_error_page::BuildHtml( |
| 215 allow_access_requests, profile_image_url, profile_image_url2, custodian, | 214 allow_access_requests, profile_image_url, profile_image_url2, custodian, |
| 216 custodian_email, second_custodian, second_custodian_email, | 215 custodian_email, second_custodian, second_custodian_email, |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 supervised_user_service->RemoveObserver(this); | 330 supervised_user_service->RemoveObserver(this); |
| 332 | 331 |
| 333 if (!callback_.is_null()) | 332 if (!callback_.is_null()) |
| 334 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 333 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 335 base::Bind(callback_, continue_request)); | 334 base::Bind(callback_, continue_request)); |
| 336 | 335 |
| 337 // After this, the WebContents may be destroyed. Make sure we don't try to use | 336 // After this, the WebContents may be destroyed. Make sure we don't try to use |
| 338 // it again. | 337 // it again. |
| 339 web_contents_ = NULL; | 338 web_contents_ = NULL; |
| 340 } | 339 } |
| OLD | NEW |