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

Unified Diff: chrome/browser/ui/alternate_error_tab_observer.cc

Issue 137623011: Switch to using the new Link Doctor API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Really fix ChromeOS Created 6 years, 11 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/ui/alternate_error_tab_observer.cc
===================================================================
--- chrome/browser/ui/alternate_error_tab_observer.cc (revision 248295)
+++ chrome/browser/ui/alternate_error_tab_observer.cc (working copy)
@@ -15,6 +15,7 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
+#include "google_apis/google_api_keys.h"
using content::RenderFrameHost;
using content::RenderViewHost;
@@ -79,13 +80,11 @@
if (profile_->IsOffTheRecord())
return url;
- if (profile_->GetPrefs()->GetBoolean(prefs::kAlternateErrorPagesEnabled)) {
- url = google_util::LinkDoctorBaseURL();
- if (!url.is_valid())
- return url;
- url = google_util::AppendGoogleLocaleParam(url);
- url = google_util::AppendGoogleTLDParam(profile_, url);
- }
+ // Don't use alternate error pages when disabled.
+ if (!profile_->GetPrefs()->GetBoolean(prefs::kAlternateErrorPagesEnabled))
+ return url;
+
+ url = google_util::LinkDoctorBaseURL();
return url;
}
@@ -96,6 +95,11 @@
void AlternateErrorPageTabObserver::UpdateAlternateErrorPageURL(
RenderViewHost* rvh) {
RenderFrameHost* rfh = rvh->GetMainFrame();
- rfh->Send(new ChromeViewMsg_SetAltErrorPageURL(
- rfh->GetRoutingID(), GetAlternateErrorPageURL()));
+ rfh->Send(new ChromeViewMsg_SetLinkDoctorInfo(
+ rfh->GetRoutingID(),
+ GetAlternateErrorPageURL(),
+ google_util::GetGoogleLocale(),
+ google_util::GetGoogleCountryCodeCode(profile_),
+ google_apis::GetAPIKey(),
+ google_util::GetGoogleSearchURL(profile_)));
}

Powered by Google App Engine
This is Rietveld 408576698