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

Unified Diff: chrome/renderer/net/net_error_helper.cc

Issue 961443002: Three way experiment for "Show saved copy" button. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: histograms fix Created 5 years, 10 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 | « chrome/renderer/net/net_error_helper.h ('k') | chrome/renderer/net/net_error_page_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/net/net_error_helper.cc
diff --git a/chrome/renderer/net/net_error_helper.cc b/chrome/renderer/net/net_error_helper.cc
index be127aa9f5400bb3eee8b4037da7e8b632880fbf..516194cd7e93825142962c8cef8b41d21c0b04c4 100644
--- a/chrome/renderer/net/net_error_helper.cc
+++ b/chrome/renderer/net/net_error_helper.cc
@@ -96,8 +96,8 @@ void NetErrorHelper::ReloadButtonPressed() {
core_->ExecuteButtonPress(NetErrorHelperCore::RELOAD_BUTTON);
}
-void NetErrorHelper::LoadStaleButtonPressed() {
- core_->ExecuteButtonPress(NetErrorHelperCore::LOAD_STALE_BUTTON);
+void NetErrorHelper::ShowSavedCopyButtonPressed() {
+ core_->ExecuteButtonPress(NetErrorHelperCore::SHOW_SAVED_COPY_BUTTON);
}
void NetErrorHelper::MoreButtonPressed() {
@@ -171,7 +171,7 @@ void NetErrorHelper::GenerateLocalizedErrorPage(
bool is_failed_post,
scoped_ptr<ErrorPageParams> params,
bool* reload_button_shown,
- bool* load_stale_button_shown,
+ bool* show_saved_copy_button_shown,
std::string* error_html) const {
error_html->clear();
@@ -181,21 +181,17 @@ void NetErrorHelper::GenerateLocalizedErrorPage(
if (template_html.empty()) {
NOTREACHED() << "unable to load template.";
} else {
- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- bool load_stale_cache_enabled =
- command_line->HasSwitch(switches::kEnableOfflineLoadStaleCache);
-
base::DictionaryValue error_strings;
LocalizedError::GetStrings(error.reason, error.domain.utf8(),
error.unreachableURL, is_failed_post,
- (load_stale_cache_enabled &&
- error.staleCopyInCache && !is_failed_post),
+ error.staleCopyInCache,
RenderThread::Get()->GetLocale(),
render_frame()->GetRenderView()->
GetAcceptLanguages(),
params.Pass(), &error_strings);
*reload_button_shown = error_strings.Get("reloadButton", NULL);
- *load_stale_button_shown = error_strings.Get("staleLoadButton", NULL);
+ *show_saved_copy_button_shown =
+ error_strings.Get("showSavedCopyButton", NULL);
// "t" is the id of the template's root node.
*error_html = webui::GetTemplatesHtml(template_html, &error_strings, "t");
@@ -217,17 +213,12 @@ void NetErrorHelper::EnablePageHelperFunctions() {
void NetErrorHelper::UpdateErrorPage(const blink::WebURLError& error,
bool is_failed_post) {
- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- bool load_stale_cache_enabled =
- command_line->HasSwitch(switches::kEnableOfflineLoadStaleCache);
-
base::DictionaryValue error_strings;
LocalizedError::GetStrings(error.reason,
error.domain.utf8(),
error.unreachableURL,
is_failed_post,
- (load_stale_cache_enabled &&
- error.staleCopyInCache && !is_failed_post),
+ error.staleCopyInCache,
RenderThread::Get()->GetLocale(),
render_frame()->GetRenderView()->
GetAcceptLanguages(),
« no previous file with comments | « chrome/renderer/net/net_error_helper.h ('k') | chrome/renderer/net/net_error_page_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698