| 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/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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 l10n_util::GetStringUTF16(IDS_BLOCK_INTERSTITIAL_REQUEST_ACCESS_BUTTON)); | 148 l10n_util::GetStringUTF16(IDS_BLOCK_INTERSTITIAL_REQUEST_ACCESS_BUTTON)); |
| 149 | 149 |
| 150 strings.SetString( | 150 strings.SetString( |
| 151 "requestSentMessage", | 151 "requestSentMessage", |
| 152 l10n_util::GetStringFUTF16(IDS_BLOCK_INTERSTITIAL_REQUEST_SENT_MESSAGE, | 152 l10n_util::GetStringFUTF16(IDS_BLOCK_INTERSTITIAL_REQUEST_SENT_MESSAGE, |
| 153 custodian)); | 153 custodian)); |
| 154 | 154 |
| 155 webui::SetFontAndTextDirection(&strings); | 155 webui::SetFontAndTextDirection(&strings); |
| 156 | 156 |
| 157 base::StringPiece html(ResourceBundle::GetSharedInstance().GetRawDataResource( | 157 base::StringPiece html(ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 158 IDR_MANAGED_MODE_BLOCK_INTERSTITIAL_HTML)); | 158 IDR_SUPERVISED_USER_BLOCK_INTERSTITIAL_HTML)); |
| 159 | 159 |
| 160 webui::UseVersion2 version; | 160 webui::UseVersion2 version; |
| 161 return webui::GetI18nTemplateHtml(html, &strings); | 161 return webui::GetI18nTemplateHtml(html, &strings); |
| 162 } | 162 } |
| 163 | 163 |
| 164 void SupervisedUserInterstitial::CommandReceived(const std::string& command) { | 164 void SupervisedUserInterstitial::CommandReceived(const std::string& command) { |
| 165 // For use in histograms. | 165 // For use in histograms. |
| 166 enum Commands { | 166 enum Commands { |
| 167 PREVIEW, | 167 PREVIEW, |
| 168 BACK, | 168 BACK, |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 void SupervisedUserInterstitial::DispatchContinueRequest( | 227 void SupervisedUserInterstitial::DispatchContinueRequest( |
| 228 bool continue_request) { | 228 bool continue_request) { |
| 229 // If there is no history entry to go back to, close the tab instead. | 229 // If there is no history entry to go back to, close the tab instead. |
| 230 int nav_entry_count = web_contents_->GetController().GetEntryCount(); | 230 int nav_entry_count = web_contents_->GetController().GetEntryCount(); |
| 231 if (!continue_request && nav_entry_count == 0) | 231 if (!continue_request && nav_entry_count == 0) |
| 232 web_contents_->Close(); | 232 web_contents_->Close(); |
| 233 | 233 |
| 234 BrowserThread::PostTask( | 234 BrowserThread::PostTask( |
| 235 BrowserThread::IO, FROM_HERE, base::Bind(callback_, continue_request)); | 235 BrowserThread::IO, FROM_HERE, base::Bind(callback_, continue_request)); |
| 236 } | 236 } |
| OLD | NEW |