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

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

Issue 509173005: Supervised user interstitial: Remove image URL resolving hack. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 8349992a0aebd37f969eb2c81babd8850c2fe6be..a87ed8cd127aed77d99c486199fbe8bc3f400ed8 100644
--- a/chrome/browser/supervised_user/supervised_user_interstitial.cc
+++ b/chrome/browser/supervised_user/supervised_user_interstitial.cc
@@ -37,14 +37,12 @@ namespace {
static const int kAvatarSize1x = 45;
static const int kAvatarSize2x = 90;
-std::string BuildAvatarImageUrl(const std::string& url,
- const GURL& base_url,
- int size) {
+std::string BuildAvatarImageUrl(const std::string& url, int size) {
std::string result = url;
size_t slash = result.rfind('/');
if (slash != std::string::npos)
result.insert(slash, "/s" + base::IntToString(size));
- return base_url.Resolve(result).spec();
+ return result;
}
} // namespace
@@ -148,32 +146,18 @@ std::string SupervisedUserInterstitial::GetHTMLContents() {
bool allow_access_requests = supervised_user_service->AccessRequestsEnabled();
strings.SetBoolean("allowAccessRequests", allow_access_requests);
- 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,
- base_url,
kAvatarSize1x));
strings.SetString("avatarURL2x", BuildAvatarImageUrl(profile_image_url,
- base_url,
kAvatarSize2x));
- 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,
- base_url2,
kAvatarSize1x));
strings.SetString("secondAvatarURL2x", BuildAvatarImageUrl(profile_image_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