| Index: ui/views/mus/surface_binding.cc
|
| diff --git a/ui/views/mus/surface_binding.cc b/ui/views/mus/surface_binding.cc
|
| index e31129c53d88a570e1aeacd1725126804615161c..90a09ba1169333b44414bf4494c00294e4c7e199 100644
|
| --- a/ui/views/mus/surface_binding.cc
|
| +++ b/ui/views/mus/surface_binding.cc
|
| @@ -26,15 +26,10 @@
|
| #include "mojo/converters/geometry/geometry_type_converters.h"
|
| #include "mojo/converters/surfaces/surfaces_type_converters.h"
|
| #include "mojo/public/cpp/bindings/binding.h"
|
| -#include "mojo/shell/public/cpp/application_impl.h"
|
| -#include "mojo/shell/public/cpp/connect.h"
|
| -#include "mojo/shell/public/interfaces/shell.mojom.h"
|
| +#include "mojo/shell/public/cpp/shell.h"
|
| #include "ui/views/mus/window_tree_host_mus.h"
|
|
|
| namespace views {
|
| -namespace {
|
| -void OnGotRemoteIDs(uint32_t remote_id, uint32_t content_handler_id) {}
|
| -} // namespace
|
|
|
| // PerConnectionState ----------------------------------------------------------
|
|
|
| @@ -46,7 +41,7 @@ void OnGotRemoteIDs(uint32_t remote_id, uint32_t content_handler_id) {}
|
| class SurfaceBinding::PerConnectionState
|
| : public base::RefCounted<PerConnectionState> {
|
| public:
|
| - static PerConnectionState* Get(mojo::shell::mojom::Shell* shell,
|
| + static PerConnectionState* Get(mojo::Shell* shell,
|
| mus::WindowTreeConnection* connection);
|
|
|
| scoped_ptr<cc::OutputSurface> CreateOutputSurface(
|
| @@ -59,8 +54,7 @@ class SurfaceBinding::PerConnectionState
|
|
|
| friend class base::RefCounted<PerConnectionState>;
|
|
|
| - PerConnectionState(mojo::shell::mojom::Shell* shell,
|
| - mus::WindowTreeConnection* connection);
|
| + PerConnectionState(mojo::Shell* shell, mus::WindowTreeConnection* connection);
|
| ~PerConnectionState();
|
|
|
| void Init();
|
| @@ -68,7 +62,7 @@ class SurfaceBinding::PerConnectionState
|
| static base::LazyInstance<
|
| base::ThreadLocalPointer<ConnectionToStateMap>>::Leaky window_states;
|
|
|
| - mojo::shell::mojom::Shell* shell_;
|
| + mojo::Shell* shell_;
|
| mus::WindowTreeConnection* connection_;
|
|
|
| // Set of state needed to create an OutputSurface.
|
| @@ -84,7 +78,7 @@ base::LazyInstance<base::ThreadLocalPointer<
|
|
|
| // static
|
| SurfaceBinding::PerConnectionState* SurfaceBinding::PerConnectionState::Get(
|
| - mojo::shell::mojom::Shell* shell,
|
| + mojo::Shell* shell,
|
| mus::WindowTreeConnection* connection) {
|
| ConnectionToStateMap* window_map = window_states.Pointer()->Get();
|
| if (!window_map) {
|
| @@ -114,7 +108,7 @@ SurfaceBinding::PerConnectionState::CreateOutputSurface(
|
| }
|
|
|
| SurfaceBinding::PerConnectionState::PerConnectionState(
|
| - mojo::shell::mojom::Shell* shell,
|
| + mojo::Shell* shell,
|
| mus::WindowTreeConnection* connection)
|
| : shell_(shell), connection_(connection) {}
|
|
|
| @@ -130,19 +124,12 @@ SurfaceBinding::PerConnectionState::~PerConnectionState() {
|
| }
|
|
|
| void SurfaceBinding::PerConnectionState::Init() {
|
| - mojo::ServiceProviderPtr service_provider;
|
| - mojo::URLRequestPtr request(mojo::URLRequest::New());
|
| - request->url = mojo::String::From("mojo:mus");
|
| - shell_->ConnectToApplication(std::move(request), GetProxy(&service_provider),
|
| - nullptr,
|
| - mojo::CreatePermissiveCapabilityFilter(),
|
| - base::Bind(&OnGotRemoteIDs));
|
| - ConnectToService(service_provider.get(), &gpu_);
|
| + shell_->ConnectToService("mojo:mus", &gpu_);
|
| }
|
|
|
| // SurfaceBinding --------------------------------------------------------------
|
|
|
| -SurfaceBinding::SurfaceBinding(mojo::shell::mojom::Shell* shell,
|
| +SurfaceBinding::SurfaceBinding(mojo::Shell* shell,
|
| mus::Window* window,
|
| mus::mojom::SurfaceType surface_type)
|
| : window_(window),
|
|
|