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

Unified Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 13375003: Fixing iframe jank in the local omnibox popup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Include missing file. Created 7 years, 9 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 8c3e65294ce5e20178bd40e8ddd0012e9fc094e7..bd73bc1da94f451291da067c74b45f4de339636d 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -11,6 +11,7 @@
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/path_service.h"
+#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/common/child_process_logging.h"
@@ -217,15 +218,6 @@ bool ShouldUseJavaScriptSettingForPlugin(const WebPluginInfo& plugin) {
return false;
}
-content::RenderView* GetRenderViewFromWebFrame(WebKit::WebFrame* webframe) {
- if (!webframe)
- return NULL;
- WebKit::WebView* webview = webframe->view();
- if (!webview)
- return NULL;
- return content::RenderView::FromWebView(webview);
-}
-
} // namespace
namespace chrome {
@@ -994,13 +986,18 @@ bool ChromeContentRendererClient::WillSendRequest(
return true;
}
- const content::RenderView* render_view = GetRenderViewFromWebFrame(frame);
- if (SearchBox* search_box = SearchBox::Get(render_view)) {
- if (url.SchemeIs(chrome::kChromeSearchScheme) &&
- url.host() == chrome::kChromeSearchSuggestionHost) {
- if (search_box->GenerateDataURLForSuggestionRequest(url, new_url))
- return true;
- }
+ if (url.SchemeIs(chrome::kChromeSearchScheme) &&
+ url.host() == chrome::kChromeSearchSuggestionHost) {
+ GURL top_url(frame->top()->document().url());
+ // Note that this replaces any existing &origin param.
samarth 2013/04/02 23:26:58 This also replaces any other query params, but I s
Jered 2013/04/04 17:30:10 Done.
+ GURL::Replacements set_origin;
+ std::string query_str = "origin=";
+ query_str.append(top_url.GetOrigin().spec());
+ // Origin should not include a trailing slash. That is part of the path.
+ TrimString(query_str, "/", &query_str);
+ set_origin.SetQueryStr(query_str);
+ *new_url = url.ReplaceComponents(set_origin);
+ return true;
}
return false;

Powered by Google App Engine
This is Rietveld 408576698