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

Unified Diff: components/error_page/renderer/net_error_helper_core.h

Issue 1410343007: Add "SHOW ALL SAVED PAGES" button to offline error page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch Created 5 years, 1 month 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: components/error_page/renderer/net_error_helper_core.h
diff --git a/components/error_page/renderer/net_error_helper_core.h b/components/error_page/renderer/net_error_helper_core.h
index 6a3dc7b86035182471273cf35137e5cceb40ac61..47810f591b21c3769aa1b7ba514fb4f7e49748c9 100644
--- a/components/error_page/renderer/net_error_helper_core.h
+++ b/components/error_page/renderer/net_error_helper_core.h
@@ -50,6 +50,7 @@ class NetErrorHelperCore {
EASTER_EGG,
SHOW_CACHED_COPY_BUTTON, // "Google cached copy" button label experiment.
DIAGNOSE_ERROR,
+ SHOW_SAVED_PAGES_BUTTON,
};
// The Delegate handles all interaction with the RenderView, WebFrame, and
@@ -61,10 +62,12 @@ class NetErrorHelperCore {
const blink::WebURLError& error,
bool is_failed_post,
bool can_show_network_diagnostics_dialog,
+ bool has_offline_pages,
scoped_ptr<ErrorPageParams> params,
bool* reload_button_shown,
bool* show_saved_copy_button_shown,
bool* show_cached_copy_button_shown,
+ bool* show_saved_pages_button_shown,
std::string* html) const = 0;
// Loads the given HTML in the frame for use as an error page.
@@ -80,7 +83,8 @@ class NetErrorHelperCore {
// been generated by a call to GenerateLocalizedErrorPage.
virtual void UpdateErrorPage(const blink::WebURLError& error,
bool is_failed_post,
- bool can_show_network_diagnostics_dialog) = 0;
+ bool can_show_network_diagnostics_dialog,
+ bool has_offline_pages) = 0;
// Fetches an error page and calls into OnErrorPageFetched when done. Any
// previous fetch must either be canceled or finished before calling. Can't
@@ -108,6 +112,9 @@ class NetErrorHelperCore {
// Run the platform diagnostics too for the specified URL.
virtual void DiagnoseError(const GURL& page_url) = 0;
+ // Shows the UI for offline pages.
+ virtual void ShowOfflinePages() = 0;
+
protected:
virtual ~Delegate() {}
};
@@ -169,6 +176,10 @@ class NetErrorHelperCore {
const std::string& country_code,
const std::string& api_key,
const GURL& search_url);
+
+ // Notifies by the browser whether an offline page exists.
+ void OnSetHasOfflinePages(bool has_offline_pages);
+
// Notifies |this| that the network's online status changed.
// Handler for NetworkStateChanged notification from the browser process. If
// the network state changes to online, this method is responsible for
@@ -279,6 +290,10 @@ class NetErrorHelperCore {
// the error page. It is used to detect when such navigations result
// in errors.
Button navigation_from_button_;
+
+ // Whether an offline page exists. This is used to decide if "Show saved
+ // pages" will be provided in certain error page.
+ bool has_offline_pages_;
};
} // namespace error_page

Powered by Google App Engine
This is Rietveld 408576698