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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « chrome/common/instant.mojom ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/searchbox/searchbox.h" 5 #include "chrome/renderer/searchbox/searchbox.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 SearchBox::SearchBox(content::RenderFrame* render_frame) 237 SearchBox::SearchBox(content::RenderFrame* render_frame)
238 : content::RenderFrameObserver(render_frame), 238 : content::RenderFrameObserver(render_frame),
239 content::RenderFrameObserverTracker<SearchBox>(render_frame), 239 content::RenderFrameObserverTracker<SearchBox>(render_frame),
240 page_seq_no_(0), 240 page_seq_no_(0),
241 is_focused_(false), 241 is_focused_(false),
242 is_input_in_progress_(false), 242 is_input_in_progress_(false),
243 is_key_capture_enabled_(false), 243 is_key_capture_enabled_(false),
244 most_visited_items_cache_(kMaxInstantMostVisitedItemCacheSize), 244 most_visited_items_cache_(kMaxInstantMostVisitedItemCacheSize),
245 query_(), 245 query_(),
246 binding_(this) { 246 binding_(this) {
247 render_frame->GetRemoteAssociatedInterfaces()->GetInterface( 247 // Connect to the embedded search interface in the browser.
248 &instant_service_); 248 chrome::mojom::EmbeddedSearchConnectorAssociatedPtr connector;
249 render_frame->GetAssociatedInterfaceRegistry()->AddInterface( 249 render_frame->GetRemoteAssociatedInterfaces()->GetInterface(&connector);
250 base::Bind(&SearchBox::Bind, base::Unretained(this))); 250 chrome::mojom::SearchBoxAssociatedPtrInfo search_box;
251 binding_.Bind(&search_box);
252 connector->Connect(mojo::MakeRequest(&instant_service_),
253 std::move(search_box));
251 } 254 }
252 255
253 SearchBox::~SearchBox() { 256 SearchBox::~SearchBox() {
254 } 257 }
255 258
256 void SearchBox::LogEvent(NTPLoggingEventType event) { 259 void SearchBox::LogEvent(NTPLoggingEventType event) {
257 // navigation_start in ms. 260 // navigation_start in ms.
258 uint64_t start = 261 uint64_t start =
259 1000 * (render_frame()->GetWebFrame()->performance().navigationStart()); 262 1000 * (render_frame()->GetWebFrame()->performance().navigationStart());
260 uint64_t now = 263 uint64_t now =
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 embedded_search_request_params_ = EmbeddedSearchRequestParams(); 462 embedded_search_request_params_ = EmbeddedSearchRequestParams();
460 suggestion_ = InstantSuggestion(); 463 suggestion_ = InstantSuggestion();
461 is_focused_ = false; 464 is_focused_ = false;
462 is_key_capture_enabled_ = false; 465 is_key_capture_enabled_ = false;
463 theme_info_ = ThemeBackgroundInfo(); 466 theme_info_ = ThemeBackgroundInfo();
464 } 467 }
465 468
466 void SearchBox::OnDestruct() { 469 void SearchBox::OnDestruct() {
467 delete this; 470 delete this;
468 } 471 }
OLDNEW
« 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