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

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

Issue 495003003: Supervised user interstitial: Handle missing custodian profile URL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 6 years, 4 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 | « no previous file | no next file » | 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 17baddf27f49f5c33791d9819eb1f5b871b4df8a..f561c45f3bd67483854b964529c468308c9723d8 100644
--- a/chrome/browser/supervised_user/supervised_user_interstitial.cc
+++ b/chrome/browser/supervised_user/supervised_user_interstitial.cc
@@ -148,26 +148,32 @@ std::string SupervisedUserInterstitial::GetHTMLContents() {
bool allow_access_requests = supervised_user_service->AccessRequestsEnabled();
strings.SetBoolean("allowAccessRequests", allow_access_requests);
- GURL profile_url = GURL(profile->GetPrefs()->GetString(
+ GURL base_url = GURL(profile->GetPrefs()->GetString(
prefs::kSupervisedUserCustodianProfileURL));
+ if (!base_url.is_valid())
+ base_url = GURL("https://dummy.url");
+ DCHECK(base_url.is_valid());
std::string profile_image_url = profile->GetPrefs()->GetString(
prefs::kSupervisedUserCustodianProfileImageURL);
strings.SetString("avatarURL1x", BuildAvatarImageUrl(profile_image_url,
- profile_url,
+ base_url,
kAvatarSize1x));
strings.SetString("avatarURL2x", BuildAvatarImageUrl(profile_image_url,
- profile_url,
+ base_url,
kAvatarSize2x));
- GURL profile_url2 = GURL(profile->GetPrefs()->GetString(
+ GURL base_url2 = GURL(profile->GetPrefs()->GetString(
prefs::kSupervisedUserSecondCustodianProfileURL));
+ if (!base_url2.is_valid())
+ base_url2 = GURL("https://dummy.url");
+ DCHECK(base_url2.is_valid());
std::string profile_image_url2 = profile->GetPrefs()->GetString(
prefs::kSupervisedUserSecondCustodianProfileImageURL);
strings.SetString("secondAvatarURL1x", BuildAvatarImageUrl(profile_image_url2,
- profile_url2,
+ base_url2,
kAvatarSize1x));
strings.SetString("secondAvatarURL2x", BuildAvatarImageUrl(profile_image_url2,
- profile_url2,
+ base_url2,
kAvatarSize2x));
base::string16 custodian =
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698