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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
260 } | 260 } |
261 } else { | 261 } else { |
262 request_sent_message = l10n_util::GetStringFUTF16( | 262 request_sent_message = l10n_util::GetStringFUTF16( |
263 IDS_BLOCK_INTERSTITIAL_REQUEST_SENT_MESSAGE, custodian); | 263 IDS_BLOCK_INTERSTITIAL_REQUEST_SENT_MESSAGE, custodian); |
264 request_failed_message = l10n_util::GetStringFUTF16( | 264 request_failed_message = l10n_util::GetStringFUTF16( |
265 IDS_BLOCK_INTERSTITIAL_REQUEST_FAILED_MESSAGE, custodian); | 265 IDS_BLOCK_INTERSTITIAL_REQUEST_FAILED_MESSAGE, custodian); |
266 } | 266 } |
267 strings.SetString("requestSentMessage", request_sent_message); | 267 strings.SetString("requestSentMessage", request_sent_message); |
268 strings.SetString("requestFailedMessage", request_failed_message); | 268 strings.SetString("requestFailedMessage", request_failed_message); |
269 | 269 |
270 webui::SetFontAndTextDirection(&strings); | 270 webui::SetTextDirection(&strings); |
271 | 271 |
272 base::StringPiece html(ResourceBundle::GetSharedInstance().GetRawDataResource( | 272 std::string html = |
273 IDR_SUPERVISED_USER_BLOCK_INTERSTITIAL_HTML)); | 273 ResourceBundle::GetSharedInstance() |
274 .GetRawDataResource(IDR_SUPERVISED_USER_BLOCK_INTERSTITIAL_HTML) | |
275 .as_string(); | |
Dan Beam
2015/01/21 19:21:41
i don't really care much, and this could be clant-
Bernhard Bauer
2015/01/21 22:47:50
Hm, I think for method calls the dot on the beginn
| |
276 webui::AppendWebUICSSTextDefaults(&html); | |
274 | 277 |
275 return webui::GetI18nTemplateHtml(html, &strings); | 278 return webui::GetI18nTemplateHtml(html, &strings); |
276 } | 279 } |
277 | 280 |
278 void SupervisedUserInterstitial::CommandReceived(const std::string& command) { | 281 void SupervisedUserInterstitial::CommandReceived(const std::string& command) { |
279 // For use in histograms. | 282 // For use in histograms. |
280 enum Commands { | 283 enum Commands { |
281 PREVIEW, | 284 PREVIEW, |
282 BACK, | 285 BACK, |
283 NTP, | 286 NTP, |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
371 SupervisedUserServiceFactory::GetForProfile(profile_); | 374 SupervisedUserServiceFactory::GetForProfile(profile_); |
372 supervised_user_service->RemoveObserver(this); | 375 supervised_user_service->RemoveObserver(this); |
373 | 376 |
374 BrowserThread::PostTask( | 377 BrowserThread::PostTask( |
375 BrowserThread::IO, FROM_HERE, base::Bind(callback_, continue_request)); | 378 BrowserThread::IO, FROM_HERE, base::Bind(callback_, continue_request)); |
376 | 379 |
377 // After this, the WebContents may be destroyed. Make sure we don't try to use | 380 // After this, the WebContents may be destroyed. Make sure we don't try to use |
378 // it again. | 381 // it again. |
379 web_contents_ = NULL; | 382 web_contents_ = NULL; |
380 } | 383 } |
OLD | NEW |