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

Side by Side Diff: mandoline/ui/omnibox/omnibox_application.cc

Issue 1681813002: Rename Connection::AddService/ConnectToService to Connection::AddInterface/GetInterface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@interface_binder
Patch Set: . Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "mandoline/ui/omnibox/omnibox_application.h" 5 #include "mandoline/ui/omnibox/omnibox_application.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 //////////////////////////////////////////////////////////////////////////////// 83 ////////////////////////////////////////////////////////////////////////////////
84 // OmniboxApplication, mojo::ShellClient implementation: 84 // OmniboxApplication, mojo::ShellClient implementation:
85 85
86 void OmniboxApplication::Initialize(mojo::Shell* shell, const std::string& url, 86 void OmniboxApplication::Initialize(mojo::Shell* shell, const std::string& url,
87 uint32_t id) { 87 uint32_t id) {
88 shell_ = shell; 88 shell_ = shell;
89 tracing_.Initialize(shell, url); 89 tracing_.Initialize(shell, url);
90 } 90 }
91 91
92 bool OmniboxApplication::AcceptConnection(mojo::Connection* connection) { 92 bool OmniboxApplication::AcceptConnection(mojo::Connection* connection) {
93 connection->AddService<Omnibox>(this); 93 connection->AddInterface<Omnibox>(this);
94 return true; 94 return true;
95 } 95 }
96 96
97 //////////////////////////////////////////////////////////////////////////////// 97 ////////////////////////////////////////////////////////////////////////////////
98 // OmniboxApplication, mojo::InterfaceFactory<Omnibox> implementation: 98 // OmniboxApplication, mojo::InterfaceFactory<Omnibox> implementation:
99 99
100 void OmniboxApplication::Create(mojo::Connection* connection, 100 void OmniboxApplication::Create(mojo::Connection* connection,
101 mojo::InterfaceRequest<Omnibox> request) { 101 mojo::InterfaceRequest<Omnibox> request) {
102 new OmniboxImpl(shell_, connection, std::move(request)); 102 new OmniboxImpl(shell_, connection, std::move(request));
103 } 103 }
104 104
105 //////////////////////////////////////////////////////////////////////////////// 105 ////////////////////////////////////////////////////////////////////////////////
106 // OmniboxImpl, public: 106 // OmniboxImpl, public:
107 107
108 OmniboxImpl::OmniboxImpl(mojo::Shell* shell, 108 OmniboxImpl::OmniboxImpl(mojo::Shell* shell,
109 mojo::Connection* connection, 109 mojo::Connection* connection,
110 mojo::InterfaceRequest<Omnibox> request) 110 mojo::InterfaceRequest<Omnibox> request)
111 : shell_(shell), 111 : shell_(shell),
112 root_(nullptr), 112 root_(nullptr),
113 edit_(nullptr), 113 edit_(nullptr),
114 binding_(this, std::move(request)) { 114 binding_(this, std::move(request)) {
115 connection->ConnectToService(&view_embedder_); 115 connection->GetInterface(&view_embedder_);
116 } 116 }
117 OmniboxImpl::~OmniboxImpl() {} 117 OmniboxImpl::~OmniboxImpl() {}
118 118
119 //////////////////////////////////////////////////////////////////////////////// 119 ////////////////////////////////////////////////////////////////////////////////
120 // OmniboxImpl, mus::WindowTreeDelegate implementation: 120 // OmniboxImpl, mus::WindowTreeDelegate implementation:
121 121
122 void OmniboxImpl::OnEmbed(mus::Window* root) { 122 void OmniboxImpl::OnEmbed(mus::Window* root) {
123 root_ = root; 123 root_ = root;
124 124
125 if (!aura_init_.get()) { 125 if (!aura_init_.get()) {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 edit_->SelectAll(false); 226 edit_->SelectAll(false);
227 edit_->RequestFocus(); 227 edit_->RequestFocus();
228 } 228 }
229 229
230 void OmniboxImpl::HideWindow() { 230 void OmniboxImpl::HideWindow() {
231 DCHECK(root_); 231 DCHECK(root_);
232 root_->SetVisible(false); 232 root_->SetVisible(false);
233 } 233 }
234 234
235 } // namespace mandoline 235 } // namespace mandoline
OLDNEW
« no previous file with comments | « mandoline/ui/desktop_ui/browser_window.cc ('k') | mandoline/ui/phone_ui/phone_browser_application_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698