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_))); |
} |