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

Unified Diff: ui/views/mus/surface_binding.cc

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/mus/surface_binding.h ('k') | ui/views/mus/surface_context_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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),
« no previous file with comments | « ui/views/mus/surface_binding.h ('k') | ui/views/mus/surface_context_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698