| OLD | NEW |
| 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_impl.h" | 5 #include "mandoline/ui/omnibox/omnibox_impl.h" |
| 6 | 6 |
| 7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
| 8 #include "components/view_manager/public/cpp/view_manager_client_factory.h" | 8 #include "components/view_manager/public/cpp/view_manager_client_factory.h" |
| 9 #include "mandoline/ui/aura/aura_init.h" | 9 #include "mandoline/ui/aura/aura_init.h" |
| 10 #include "mandoline/ui/aura/native_widget_view_manager.h" | 10 #include "mandoline/ui/aura/native_widget_view_manager.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 void OmniboxImpl::Initialize(mojo::ApplicationImpl* app) { | 32 void OmniboxImpl::Initialize(mojo::ApplicationImpl* app) { |
| 33 app_impl_ = app; | 33 app_impl_ = app; |
| 34 view_manager_client_factory_.reset( | 34 view_manager_client_factory_.reset( |
| 35 new mojo::ViewManagerClientFactory(app->shell(), this)); | 35 new mojo::ViewManagerClientFactory(app->shell(), this)); |
| 36 } | 36 } |
| 37 | 37 |
| 38 bool OmniboxImpl::ConfigureIncomingConnection( | 38 bool OmniboxImpl::ConfigureIncomingConnection( |
| 39 mojo::ApplicationConnection* connection) { | 39 mojo::ApplicationConnection* connection) { |
| 40 connection->AddService<Omnibox>(this); | 40 connection->AddService<Omnibox>(this); |
| 41 connection->AddService(view_manager_client_factory_.get()); | 41 connection->AddService(view_manager_client_factory_.get()); |
| 42 connection->ConnectToService(&view_embedder_); |
| 42 return true; | 43 return true; |
| 43 } | 44 } |
| 44 | 45 |
| 45 bool OmniboxImpl::ConfigureOutgoingConnection( | 46 bool OmniboxImpl::ConfigureOutgoingConnection( |
| 46 mojo::ApplicationConnection* connection) { | 47 mojo::ApplicationConnection* connection) { |
| 47 return true; | 48 return true; |
| 48 } | 49 } |
| 49 | 50 |
| 50 //////////////////////////////////////////////////////////////////////////////// | 51 //////////////////////////////////////////////////////////////////////////////// |
| 51 // OmniboxImpl, mojo::ViewManagerDelegate implementation: | 52 // OmniboxImpl, mojo::ViewManagerDelegate implementation: |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 128 |
| 128 //////////////////////////////////////////////////////////////////////////////// | 129 //////////////////////////////////////////////////////////////////////////////// |
| 129 // OmniboxImpl, Omnibox implementation: | 130 // OmniboxImpl, Omnibox implementation: |
| 130 | 131 |
| 131 void OmniboxImpl::SetClient(OmniboxClientPtr client) { | 132 void OmniboxImpl::SetClient(OmniboxClientPtr client) { |
| 132 client_ = client.Pass(); | 133 client_ = client.Pass(); |
| 133 } | 134 } |
| 134 | 135 |
| 135 void OmniboxImpl::ShowForURL(const mojo::String& url) { | 136 void OmniboxImpl::ShowForURL(const mojo::String& url) { |
| 136 url_ = url; | 137 url_ = url; |
| 137 // TODO: get embedding working. | 138 |
| 139 view_embedder_->Embed("mojo:omnibox", nullptr, nullptr); |
| 138 } | 140 } |
| 139 | 141 |
| 140 } // namespace mandoline | 142 } // namespace mandoline |
| OLD | NEW |