| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/managed_mode/managed_mode_interstitial.h" | 5 #include "chrome/browser/managed_mode/managed_mode_interstitial.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.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/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 languages_ = prefs->GetString(prefs::kAcceptLanguages); | 94 languages_ = prefs->GetString(prefs::kAcceptLanguages); |
| 95 interstitial_page_ = | 95 interstitial_page_ = |
| 96 content::InterstitialPage::Create(web_contents, true, url_, this); | 96 content::InterstitialPage::Create(web_contents, true, url_, this); |
| 97 interstitial_page_->Show(); | 97 interstitial_page_->Show(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 ManagedModeInterstitial::~ManagedModeInterstitial() {} | 100 ManagedModeInterstitial::~ManagedModeInterstitial() {} |
| 101 | 101 |
| 102 std::string ManagedModeInterstitial::GetHTMLContents() { | 102 std::string ManagedModeInterstitial::GetHTMLContents() { |
| 103 DictionaryValue strings; | 103 base::DictionaryValue strings; |
| 104 strings.SetString("blockPageTitle", | 104 strings.SetString("blockPageTitle", |
| 105 l10n_util::GetStringUTF16(IDS_BLOCK_INTERSTITIAL_TITLE)); | 105 l10n_util::GetStringUTF16(IDS_BLOCK_INTERSTITIAL_TITLE)); |
| 106 | 106 |
| 107 Profile* profile = | 107 Profile* profile = |
| 108 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); | 108 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); |
| 109 ManagedUserService* managed_user_service = | 109 ManagedUserService* managed_user_service = |
| 110 ManagedUserServiceFactory::GetForProfile(profile); | 110 ManagedUserServiceFactory::GetForProfile(profile); |
| 111 | 111 |
| 112 bool allow_access_requests = managed_user_service->AccessRequestsEnabled(); | 112 bool allow_access_requests = managed_user_service->AccessRequestsEnabled(); |
| 113 strings.SetBoolean("allowAccessRequests", allow_access_requests); | 113 strings.SetBoolean("allowAccessRequests", allow_access_requests); |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 201 |
| 202 void ManagedModeInterstitial::OnFilteringPrefsChanged() { | 202 void ManagedModeInterstitial::OnFilteringPrefsChanged() { |
| 203 if (ShouldProceed()) | 203 if (ShouldProceed()) |
| 204 interstitial_page_->Proceed(); | 204 interstitial_page_->Proceed(); |
| 205 } | 205 } |
| 206 | 206 |
| 207 void ManagedModeInterstitial::DispatchContinueRequest(bool continue_request) { | 207 void ManagedModeInterstitial::DispatchContinueRequest(bool continue_request) { |
| 208 BrowserThread::PostTask( | 208 BrowserThread::PostTask( |
| 209 BrowserThread::IO, FROM_HERE, base::Bind(callback_, continue_request)); | 209 BrowserThread::IO, FROM_HERE, base::Bind(callback_, continue_request)); |
| 210 } | 210 } |
| OLD | NEW |