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

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: Manual rebase to fix merge problem Created 4 years, 11 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
« no previous file with comments | « chrome/browser/supervised_user/supervised_user_interstitial.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 91cd04d9fa7e8c3496ff959c78b5ac3887b36464..21735f78106f5594f6e2a9fb8e8c2224c0699551 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());
@@ -256,14 +259,13 @@ std::string SupervisedUserInterstitial::GetHTMLContents() {
strings.SetString("blockPageMessage", block_message);
strings.SetString("blockReasonMessage", l10n_util::GetStringUTF16(
SupervisedUserURLFilter::GetBlockMessageID(
- reason_, is_child_account, second_custodian.empty())));
+ reason, is_child_account, second_custodian.empty())));
strings.SetString("blockReasonHeader", l10n_util::GetStringUTF16(
- SupervisedUserURLFilter::GetBlockHeaderID(reason_)));
-
+ SupervisedUserURLFilter::GetBlockHeaderID(reason)));
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",
@@ -313,6 +315,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 {
« no previous file with comments | « chrome/browser/supervised_user/supervised_user_interstitial.h ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698