Index: chrome/browser/interstitials/chrome_controller_client.cc |
diff --git a/chrome/browser/interstitials/chrome_controller_client.cc b/chrome/browser/interstitials/chrome_controller_client.cc |
index aca6d3e2fd1e7e9e3d5110c26be06e4c6c088d53..501f09169a03f30d3540db1903c2eb3bd942902f 100644 |
--- a/chrome/browser/interstitials/chrome_controller_client.cc |
+++ b/chrome/browser/interstitials/chrome_controller_client.cc |
@@ -13,6 +13,7 @@ |
#include "chrome/browser/interstitials/chrome_metrics_helper.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/common/pref_names.h" |
+#include "chrome/common/url_constants.h" |
#include "components/prefs/pref_service.h" |
#include "components/safe_browsing_db/safe_browsing_prefs.h" |
#include "content/public/browser/browser_thread.h" |
@@ -27,7 +28,6 @@ |
#if defined(OS_CHROMEOS) |
#include "chrome/browser/profiles/profile_manager.h" |
#include "chrome/browser/ui/chrome_pages.h" |
-#include "chrome/common/url_constants.h" |
#endif |
#if defined(OS_WIN) |
@@ -160,6 +160,19 @@ void ChromeControllerClient::GoBack() { |
interstitial_page_->DontProceed(); |
} |
+// If the offending entry has committed, go back or to a safe page without |
+// closing th error page. This error page will be closed when the new page |
estark
2016/12/15 21:16:34
typo: th => the
Jialiu Lin
2016/12/15 22:12:53
Oops. Thanks for catching this.
|
+// commits. |
+void ChromeControllerClient::GoBackAfterNavigationCommitted() { |
+ if (web_contents_->GetController().CanGoBack()) { |
+ web_contents_->GetController().GoBack(); |
+ } else { |
+ web_contents_->GetController().LoadURL( |
+ GURL(chrome::kChromeUINewTabURL), content::Referrer(), |
+ ui::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string()); |
+ } |
+} |
+ |
void ChromeControllerClient::Proceed() { |
interstitial_page_->Proceed(); |
} |