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

Unified Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 23455047: InstantExtended: Send search URLs to renderers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Missing files. Created 7 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/renderer/chrome_content_renderer_client.cc
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
index 7f4bfe242cfb23406a98e1f18063aad9f4542d68..89109bc1ee2781e9591e8d7ed330eabcfa041df6 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -58,6 +58,7 @@
#include "chrome/renderer/printing/print_web_view_helper.h"
#include "chrome/renderer/safe_browsing/malware_dom_details.h"
#include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h"
+#include "chrome/renderer/searchbox/search_bouncer.h"
#include "chrome/renderer/searchbox/searchbox.h"
#include "chrome/renderer/searchbox/searchbox_extension.h"
#include "chrome/renderer/tts_dispatcher.h"
@@ -249,6 +250,7 @@ void ChromeContentRendererClient::RenderThreadStarted() {
webrtc_logging_message_filter_ = new WebRtcLoggingMessageFilter(
content::RenderThread::Get()->GetIOMessageLoopProxy());
#endif
+ search_bouncer_.reset(new SearchBouncer());
RenderThread* thread = RenderThread::Get();
@@ -262,6 +264,7 @@ void ChromeContentRendererClient::RenderThreadStarted() {
#endif
thread->AddObserver(visited_link_slave_.get());
thread->AddObserver(prerender_dispatcher_.get());
+ thread->AddObserver(search_bouncer_.get());
#if defined(ENABLE_WEBRTC)
thread->AddFilter(webrtc_logging_message_filter_.get());
@@ -854,6 +857,11 @@ bool ChromeContentRendererClient::HasErrorPage(int http_status_code,
return true;
}
+bool ChromeContentRendererClient::ShouldSuppressErrorPage(const GURL& url) {
+ // Do not flash an error page if the Instant new tab page fails to load.
+ return search_bouncer_.get() && search_bouncer_->IsNewTabPage(url);
+}
+
void ChromeContentRendererClient::GetNavigationErrorStrings(
WebKit::WebFrame* frame,
const WebKit::WebURLRequest& failed_request,
@@ -934,9 +942,13 @@ bool ChromeContentRendererClient::ShouldFork(WebFrame* frame,
// If this is the Instant process, fork all navigations originating from the
// renderer. The destination page will then be bucketed back to this Instant
- // process if it is an Instant url, or to another process if not.
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInstantProcess))
+ // process if it is an Instant url, or to another process if not. Conversely,
+ // fork if this is a non-Instant process navigating to an Instant url, so that
+ // such navigations can also be bucketed into an Instant renderer.
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInstantProcess) ||
+ (search_bouncer_.get() && search_bouncer_->ShouldFork(url))) {
return true;
+ }
// For now, we skip the rest for POST submissions. This is because
// http://crbug.com/101395 is more likely to cause compatibility issues

Powered by Google App Engine
This is Rietveld 408576698