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

Side by Side 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, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW
« 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