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 510c783de2277d7a9ead4c8ff8d31271d9fadf46..f53271c746d6c7004688c24761863708a1842fb4 100644 |
--- a/chrome/browser/supervised_user/supervised_user_interstitial.cc |
+++ b/chrome/browser/supervised_user/supervised_user_interstitial.cc |
@@ -195,32 +195,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()); |
@@ -243,15 +246,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", |
@@ -298,6 +302,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 { |