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

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

Issue 2688453002: NTP: simplify mojo connection setup (Closed)
Patch Set: Restore IsRenderedInInstantProcess check 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
« chrome/common/instant.mojom ('K') | « 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 41a44b62773bc1e543dce3ed587373d20e5c9355..42635315bcd9aa4f98130c6d016a721fd77eb89f 100644
--- a/chrome/renderer/searchbox/searchbox.cc
+++ b/chrome/renderer/searchbox/searchbox.cc
@@ -244,10 +244,14 @@ 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 NTP interface in the browser.
+ chrome::mojom::NTPConnectorAssociatedPtr ntp_connector;
+ render_frame->GetRemoteAssociatedInterfaces()->GetInterface(&ntp_connector);
+ chrome::mojom::SearchBoxAssociatedPtrInfo search_box;
+ binding_.Bind(&search_box, ntp_connector.associated_group());
+ ntp_connector->Connect(
+ mojo::MakeRequest(&instant_service_, ntp_connector.associated_group()),
+ std::move(search_box));
}
SearchBox::~SearchBox() {
« chrome/common/instant.mojom ('K') | « chrome/common/instant.mojom ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698