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

Side by Side Diff: chrome/browser/supervised_user/supervised_user_interstitial.cc

Issue 830743003: Directly inline shared WebUI CSS declarations into the security and supervised user interstitials. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698