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

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: Typo fix. (Also rebase) 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 225b776e339cd7856a0018852bf69b555f42cedf..9d97ccc40fce4fe04b0c5e13a5801e0c367f0b5b 100644
--- a/chrome/browser/managed_mode/managed_mode_interstitial.cc
+++ b/chrome/browser/managed_mode/managed_mode_interstitial.cc
@@ -224,6 +224,11 @@ 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)
+ web_contents_->Close();
+
BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE, base::Bind(callback_, continue_request));
}
« no previous file with comments | « chrome/browser/managed_mode/managed_mode_browsertest.cc ('k') | content/public/test/test_navigation_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698