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

Unified Diff: chrome/browser/managed_mode/managed_mode_interstitial.cc

Issue 248963004: "Go back" on the block interstitial closes the tab if there is no previous URL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improved test. Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/managed_mode/managed_mode_interstitial.cc
diff --git a/chrome/browser/managed_mode/managed_mode_interstitial.cc b/chrome/browser/managed_mode/managed_mode_interstitial.cc
index 04dede1c3e74322fa7bb27c609560e072e194cc4..9d38abbe60ae47482ca417a96c3a2348079c12d0 100644
--- a/chrome/browser/managed_mode/managed_mode_interstitial.cc
+++ b/chrome/browser/managed_mode/managed_mode_interstitial.cc
@@ -208,6 +208,12 @@ void ManagedModeInterstitial::OnFilteringPrefsChanged() {
}
void ManagedModeInterstitial::DispatchContinueRequest(bool continue_request) {
+ // If there is no history entry to go back to, close the tab instead.
+ int nav_entry_count = web_contents_->GetController().GetEntryCount();
+ if (!continue_request && nav_entry_count == 0) {
Bernhard Bauer 2014/04/25 08:30:13 Nit: braces are optional for one-line bodies in ge
Marc Treib 2014/04/25 08:50:34 Done.
+ web_contents_->Close();
+ }
+
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE, base::Bind(callback_, continue_request));
}

Powered by Google App Engine
This is Rietveld 408576698