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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 return url_filter->GetFilteringBehaviorForURL(url_) != | 217 return url_filter->GetFilteringBehaviorForURL(url_) != |
218 ManagedModeURLFilter::BLOCK; | 218 ManagedModeURLFilter::BLOCK; |
219 } | 219 } |
220 | 220 |
221 void ManagedModeInterstitial::OnFilteringPrefsChanged() { | 221 void ManagedModeInterstitial::OnFilteringPrefsChanged() { |
222 if (ShouldProceed()) | 222 if (ShouldProceed()) |
223 interstitial_page_->Proceed(); | 223 interstitial_page_->Proceed(); |
224 } | 224 } |
225 | 225 |
226 void ManagedModeInterstitial::DispatchContinueRequest(bool continue_request) { | 226 void ManagedModeInterstitial::DispatchContinueRequest(bool continue_request) { |
| 227 // If there is no history entry to go back to, close the tab instead. |
| 228 int nav_entry_count = web_contents_->GetController().GetEntryCount(); |
| 229 if (!continue_request && nav_entry_count == 0) |
| 230 web_contents_->Close(); |
| 231 |
227 BrowserThread::PostTask( | 232 BrowserThread::PostTask( |
228 BrowserThread::IO, FROM_HERE, base::Bind(callback_, continue_request)); | 233 BrowserThread::IO, FROM_HERE, base::Bind(callback_, continue_request)); |
229 } | 234 } |
OLD | NEW |