Index: chrome/browser/supervised_user/supervised_user_interstitial.cc |
diff --git a/chrome/browser/supervised_user/supervised_user_interstitial.cc b/chrome/browser/supervised_user/supervised_user_interstitial.cc |
index 1f7b6065488c170ede14cb4b3bc396844a08824c..b86dd7f6a591b4ca83ff9b22a4ea90a865ba2b38 100644 |
--- a/chrome/browser/supervised_user/supervised_user_interstitial.cc |
+++ b/chrome/browser/supervised_user/supervised_user_interstitial.cc |
@@ -198,32 +198,35 @@ bool SupervisedUserInterstitial::Init() { |
return true; |
} |
-std::string SupervisedUserInterstitial::GetHTMLContents() { |
+// static |
+std::string SupervisedUserInterstitial::GetHTMLContents( |
+ Profile* profile, |
+ SupervisedUserURLFilter::FilteringBehaviorReason reason) { |
base::DictionaryValue strings; |
strings.SetString("blockPageTitle", |
l10n_util::GetStringUTF16(IDS_BLOCK_INTERSTITIAL_TITLE)); |
SupervisedUserService* supervised_user_service = |
- SupervisedUserServiceFactory::GetForProfile(profile_); |
+ SupervisedUserServiceFactory::GetForProfile(profile); |
bool allow_access_requests = supervised_user_service->AccessRequestsEnabled(); |
strings.SetBoolean("allowAccessRequests", allow_access_requests); |
- std::string profile_image_url = profile_->GetPrefs()->GetString( |
+ std::string profile_image_url = profile->GetPrefs()->GetString( |
prefs::kSupervisedUserCustodianProfileImageURL); |
strings.SetString("avatarURL1x", BuildAvatarImageUrl(profile_image_url, |
kAvatarSize1x)); |
strings.SetString("avatarURL2x", BuildAvatarImageUrl(profile_image_url, |
kAvatarSize2x)); |
- std::string profile_image_url2 = profile_->GetPrefs()->GetString( |
+ std::string profile_image_url2 = profile->GetPrefs()->GetString( |
prefs::kSupervisedUserSecondCustodianProfileImageURL); |
strings.SetString("secondAvatarURL1x", BuildAvatarImageUrl(profile_image_url2, |
kAvatarSize1x)); |
strings.SetString("secondAvatarURL2x", BuildAvatarImageUrl(profile_image_url2, |
kAvatarSize2x)); |
- bool is_child_account = profile_->IsChild(); |
+ bool is_child_account = profile->IsChild(); |
base::string16 custodian = |
base::UTF8ToUTF16(supervised_user_service->GetCustodianName()); |
@@ -246,15 +249,16 @@ std::string SupervisedUserInterstitial::GetHTMLContents() { |
IDS_BLOCK_INTERSTITIAL_MESSAGE_ACCESS_REQUESTS_DISABLED); |
} |
strings.SetString("blockPageMessage", block_message); |
- strings.SetString("blockReasonMessage", is_child_account |
- ? l10n_util::GetStringUTF16( |
- SupervisedUserURLFilter::GetBlockMessageID(reason_)) |
- : base::string16()); |
+ strings.SetString( |
+ "blockReasonMessage", |
+ is_child_account ? l10n_util::GetStringUTF16( |
+ SupervisedUserURLFilter::GetBlockMessageID(reason)) |
+ : base::string16()); |
bool show_feedback = false; |
#if defined(GOOGLE_CHROME_BUILD) |
- show_feedback = is_child_account && |
- SupervisedUserURLFilter::ReasonIsAutomatic(reason_); |
+ show_feedback = |
+ is_child_account && SupervisedUserURLFilter::ReasonIsAutomatic(reason); |
#endif |
strings.SetBoolean("showFeedbackLink", show_feedback); |
strings.SetString("feedbackLink", |
@@ -301,6 +305,10 @@ std::string SupervisedUserInterstitial::GetHTMLContents() { |
return webui::GetI18nTemplateHtml(html, &strings); |
} |
+std::string SupervisedUserInterstitial::GetHTMLContents() { |
+ return GetHTMLContents(profile_, reason_); |
+} |
+ |
void SupervisedUserInterstitial::CommandReceived(const std::string& command) { |
// For use in histograms. |
enum Commands { |