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

Unified Diff: chrome/renderer/searchbox/searchbox_extension.cc

Issue 11466007: Add new IPC for searchbox to pipe SearchBox NavigateContentWindow calls to the browser. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Minor build fix for some platforms. Created 8 years 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/searchbox/searchbox.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/searchbox/searchbox_extension.cc
diff --git a/chrome/renderer/searchbox/searchbox_extension.cc b/chrome/renderer/searchbox/searchbox_extension.cc
index 654d9296add0507ac10d6b1ffaa8b26b3207011f..9115f1ff6657c1447a170182d42a9fcf8f59fe77 100644
--- a/chrome/renderer/searchbox/searchbox_extension.cc
+++ b/chrome/renderer/searchbox/searchbox_extension.cc
@@ -633,20 +633,21 @@ v8::Handle<v8::Value> SearchBoxExtensionWrapper::NavigateContentWindow(
if (!render_view || !args.Length()) return v8::Undefined();
GURL destination_url;
+ content::PageTransition transition = content::PAGE_TRANSITION_TYPED;
samarth 2012/12/12 22:05:36 Maybe add a note/TODO here to reconsider what the
Shishir 2012/12/12 22:21:08 Since this code only seems to support NavigateCont
if (args[0]->IsNumber()) {
const InstantAutocompleteResult* result = SearchBox::Get(render_view)->
GetAutocompleteResultWithId(args[0]->Uint32Value());
- if (result)
+ if (result) {
destination_url = GURL(result->destination_url);
+ transition = result->transition;
+ }
} else {
destination_url = GURL(V8ValueToUTF16(args[0]));
}
// Navigate the main frame.
- if (destination_url.is_valid()) {
- WebKit::WebURLRequest request(destination_url);
- render_view->GetWebView()->mainFrame()->loadRequest(request);
- }
+ if (destination_url.is_valid())
+ SearchBox::Get(render_view)->NavigateToURL(destination_url, transition);
return v8::Undefined();
}
« no previous file with comments | « chrome/renderer/searchbox/searchbox.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698