| 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 ? IDS_CHILD_BLOCK_INTERSTITIAL_REQUEST_SENT_MESSAGE_SINGLE_PARENT | 246 ? IDS_CHILD_BLOCK_INTERSTITIAL_REQUEST_SENT_MESSAGE_SINGLE_PARENT |
| 247 : IDS_CHILD_BLOCK_INTERSTITIAL_REQUEST_SENT_MESSAGE_MULTI_PARENT); | 247 : IDS_CHILD_BLOCK_INTERSTITIAL_REQUEST_SENT_MESSAGE_MULTI_PARENT); |
| 248 } else { | 248 } else { |
| 249 request_sent_message = l10n_util::GetStringFUTF16( | 249 request_sent_message = l10n_util::GetStringFUTF16( |
| 250 IDS_BLOCK_INTERSTITIAL_REQUEST_SENT_MESSAGE, custodian); | 250 IDS_BLOCK_INTERSTITIAL_REQUEST_SENT_MESSAGE, custodian); |
| 251 } | 251 } |
| 252 strings.SetString("requestSentMessage", request_sent_message); | 252 strings.SetString("requestSentMessage", request_sent_message); |
| 253 | 253 |
| 254 webui::SetFontAndTextDirection(&strings); | 254 webui::SetFontAndTextDirection(&strings); |
| 255 | 255 |
| 256 base::StringPiece html(ResourceBundle::GetSharedInstance().GetRawDataResource( | 256 std::string html = |
| 257 IDR_SUPERVISED_USER_BLOCK_INTERSTITIAL_HTML)); | 257 ResourceBundle::GetSharedInstance() |
| 258 .GetRawDataResource(IDR_SUPERVISED_USER_BLOCK_INTERSTITIAL_HTML) |
| 259 .as_string(); |
| 260 webui::AppendWebUICSSTextDefaults(&html); |
| 258 | 261 |
| 259 return webui::GetI18nTemplateHtml(html, &strings); | 262 return webui::GetI18nTemplateHtml(html, &strings); |
| 260 } | 263 } |
| 261 | 264 |
| 262 void SupervisedUserInterstitial::CommandReceived(const std::string& command) { | 265 void SupervisedUserInterstitial::CommandReceived(const std::string& command) { |
| 263 // For use in histograms. | 266 // For use in histograms. |
| 264 enum Commands { | 267 enum Commands { |
| 265 PREVIEW, | 268 PREVIEW, |
| 266 BACK, | 269 BACK, |
| 267 NTP, | 270 NTP, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 SupervisedUserServiceFactory::GetForProfile(profile_); | 355 SupervisedUserServiceFactory::GetForProfile(profile_); |
| 353 supervised_user_service->RemoveObserver(this); | 356 supervised_user_service->RemoveObserver(this); |
| 354 | 357 |
| 355 BrowserThread::PostTask( | 358 BrowserThread::PostTask( |
| 356 BrowserThread::IO, FROM_HERE, base::Bind(callback_, continue_request)); | 359 BrowserThread::IO, FROM_HERE, base::Bind(callback_, continue_request)); |
| 357 | 360 |
| 358 // After this, the WebContents may be destroyed. Make sure we don't try to use | 361 // After this, the WebContents may be destroyed. Make sure we don't try to use |
| 359 // it again. | 362 // it again. |
| 360 web_contents_ = NULL; | 363 web_contents_ = NULL; |
| 361 } | 364 } |
| OLD | NEW |