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

Unified Diff: chrome/browser/android/offline_pages/offline_page_tab_helper.h

Issue 2347723002: Fix the disappearance of "Offline" chip from the LocationBar when navigating to a fragment. (Closed)
Patch Set: updated per CR, fixed failing tests. Created 4 years, 3 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/android/offline_pages/offline_page_tab_helper.h
diff --git a/chrome/browser/android/offline_pages/offline_page_tab_helper.h b/chrome/browser/android/offline_pages/offline_page_tab_helper.h
index 392213d24c74f0eb299302f485009698583bc971..717dc040cff622a34d46e70551e9cb2f7cf8758d 100644
--- a/chrome/browser/android/offline_pages/offline_page_tab_helper.h
+++ b/chrome/browser/android/offline_pages/offline_page_tab_helper.h
@@ -35,6 +35,10 @@ class OfflinePageTabHelper :
// Whether the page is an offline preview.
bool is_offline_preview() const { return is_offline_preview_; }
+ // Returns provisional offline page since actual navigation does not happen
+ // during unit tests.
+ const OfflinePageItem* GetOfflinePageForTest() const;
+
private:
friend class content::WebContentsUserData<OfflinePageTabHelper>;
@@ -52,6 +56,11 @@ class OfflinePageTabHelper :
// tab. This can be used to by the Tab to synchronously ask about the offline
// info.
std::unique_ptr<OfflinePageItem> offline_page_;
+ // Potential new offline page copy. This is reset to nullptr at the start
+ // of every navigation and set by network request interceptor. If the
+ // interceptor decided to not use offline page for the navigation or was not
+ // even invoked (as in case with fragment navigation), this stays nullptr.
+ std::unique_ptr<OfflinePageItem> provisional_offline_page_;
bool reloading_url_on_net_error_ = false;

Powered by Google App Engine
This is Rietveld 408576698