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

Unified Diff: chrome/browser/android/offline_pages/recent_tab_helper.cc

Issue 2093543002: Do not snapshot error pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/android/offline_pages/recent_tab_helper_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/offline_pages/recent_tab_helper.cc
diff --git a/chrome/browser/android/offline_pages/recent_tab_helper.cc b/chrome/browser/android/offline_pages/recent_tab_helper.cc
index 6081dac07565436e825852c998d5f34d97145ea2..afb1eecc354579f32914e8f9d789d27efe58cdaa 100644
--- a/chrome/browser/android/offline_pages/recent_tab_helper.cc
+++ b/chrome/browser/android/offline_pages/recent_tab_helper.cc
@@ -92,6 +92,12 @@ void RecentTabHelper::StartSnapshot() {
if (never_do_snapshots_)
return;
+ // Ignores any non-normal pages, like error pages.
+ content::NavigationEntry* entry =
+ web_contents()->GetController().GetLastCommittedEntry();
+ if (!entry || entry->GetPageType() != content::PAGE_TYPE_NORMAL)
+ return;
+
GURL url = web_contents()->GetLastCommittedURL();
bool can_save = OfflinePageModel::CanSaveURL(url);
UMA_HISTOGRAM_BOOLEAN("OfflinePages.CanSaveRecentPage", can_save);
« no previous file with comments | « no previous file | chrome/browser/android/offline_pages/recent_tab_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698