OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/supervised_user/supervised_user_interstitial.h" | 5 #include "chrome/browser/supervised_user/supervised_user_interstitial.h" |
6 | 6 |
7 #include "base/memory/weak_ptr.h" | 7 #include "base/memory/weak_ptr.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 strings.SetString("avatarURL2x", BuildAvatarImageUrl(profile_image_url, | 185 strings.SetString("avatarURL2x", BuildAvatarImageUrl(profile_image_url, |
186 kAvatarSize2x)); | 186 kAvatarSize2x)); |
187 | 187 |
188 std::string profile_image_url2 = profile_->GetPrefs()->GetString( | 188 std::string profile_image_url2 = profile_->GetPrefs()->GetString( |
189 prefs::kSupervisedUserSecondCustodianProfileImageURL); | 189 prefs::kSupervisedUserSecondCustodianProfileImageURL); |
190 strings.SetString("secondAvatarURL1x", BuildAvatarImageUrl(profile_image_url2, | 190 strings.SetString("secondAvatarURL1x", BuildAvatarImageUrl(profile_image_url2, |
191 kAvatarSize1x)); | 191 kAvatarSize1x)); |
192 strings.SetString("secondAvatarURL2x", BuildAvatarImageUrl(profile_image_url2, | 192 strings.SetString("secondAvatarURL2x", BuildAvatarImageUrl(profile_image_url2, |
193 kAvatarSize2x)); | 193 kAvatarSize2x)); |
194 | 194 |
195 bool is_child_account = supervised_user_service->IsChildAccount(); | 195 bool is_child_account = profile_->IsChild(); |
196 | 196 |
197 base::string16 custodian = | 197 base::string16 custodian = |
198 base::UTF8ToUTF16(supervised_user_service->GetCustodianName()); | 198 base::UTF8ToUTF16(supervised_user_service->GetCustodianName()); |
199 base::string16 second_custodian = | 199 base::string16 second_custodian = |
200 base::UTF8ToUTF16(supervised_user_service->GetSecondCustodianName()); | 200 base::UTF8ToUTF16(supervised_user_service->GetSecondCustodianName()); |
201 | 201 |
202 base::string16 block_message; | 202 base::string16 block_message; |
203 if (allow_access_requests) { | 203 if (allow_access_requests) { |
204 if (is_child_account) { | 204 if (is_child_account) { |
205 block_message = l10n_util::GetStringUTF16( | 205 block_message = l10n_util::GetStringUTF16( |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 SupervisedUserServiceFactory::GetForProfile(profile_); | 319 SupervisedUserServiceFactory::GetForProfile(profile_); |
320 supervised_user_service->RemoveObserver(this); | 320 supervised_user_service->RemoveObserver(this); |
321 | 321 |
322 BrowserThread::PostTask( | 322 BrowserThread::PostTask( |
323 BrowserThread::IO, FROM_HERE, base::Bind(callback_, continue_request)); | 323 BrowserThread::IO, FROM_HERE, base::Bind(callback_, continue_request)); |
324 | 324 |
325 // After this, the WebContents may be destroyed. Make sure we don't try to use | 325 // After this, the WebContents may be destroyed. Make sure we don't try to use |
326 // it again. | 326 // it again. |
327 web_contents_ = NULL; | 327 web_contents_ = NULL; |
328 } | 328 } |
OLD | NEW |