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

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

Issue 2688453002: NTP: simplify mojo connection setup (Closed)
Patch Set: Merge Created 3 years, 10 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
« no previous file with comments | « chrome/common/instant.mojom ('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.cc
diff --git a/chrome/renderer/searchbox/searchbox.cc b/chrome/renderer/searchbox/searchbox.cc
index 2b898d8b86cb59e974a3400caf9b1951b28de08b..256a26a250ca77a21a4d0b955ce7c9abb819c3f0 100644
--- a/chrome/renderer/searchbox/searchbox.cc
+++ b/chrome/renderer/searchbox/searchbox.cc
@@ -244,10 +244,13 @@ SearchBox::SearchBox(content::RenderFrame* render_frame)
most_visited_items_cache_(kMaxInstantMostVisitedItemCacheSize),
query_(),
binding_(this) {
- render_frame->GetRemoteAssociatedInterfaces()->GetInterface(
- &instant_service_);
- render_frame->GetAssociatedInterfaceRegistry()->AddInterface(
- base::Bind(&SearchBox::Bind, base::Unretained(this)));
+ // Connect to the embedded search interface in the browser.
+ chrome::mojom::EmbeddedSearchConnectorAssociatedPtr connector;
+ render_frame->GetRemoteAssociatedInterfaces()->GetInterface(&connector);
+ chrome::mojom::SearchBoxAssociatedPtrInfo search_box;
+ binding_.Bind(&search_box);
+ connector->Connect(mojo::MakeRequest(&instant_service_),
+ std::move(search_box));
}
SearchBox::~SearchBox() {
« no previous file with comments | « chrome/common/instant.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698