Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6275)

Unified Diff: chrome/browser/supervised_user/supervised_user_interstitial.cc

Issue 1552333002: Resubmit Supervised user web restrictions content provider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Copy of original CL (base for comparison) Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 {

Powered by Google App Engine
This is Rietveld 408576698