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

Unified Diff: services/ui/service.cc

Issue 2712203002: c++ / mojo changes for 'external window mode'
Patch Set: . 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 side-by-side diff with in-line comments
Download patch
Index: services/ui/service.cc
diff --git a/services/ui/service.cc b/services/ui/service.cc
index 34f4803d4984e997f8e53951e4f666b7319bb259..2b5c9044657d69a69b56e0d50647caf355794f05 100644
--- a/services/ui/service.cc
+++ b/services/ui/service.cc
@@ -39,7 +39,7 @@
#include "services/ui/ws/window_tree.h"
#include "services/ui/ws/window_tree_binding.h"
#include "services/ui/ws/window_tree_factory.h"
-#include "services/ui/ws/window_tree_host_factory.h"
+#include "services/ui/ws/window_tree_host_factory_registrar.h"
#include "ui/base/platform_window_defaults.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
@@ -61,7 +61,6 @@
using service_manager::Connection;
using mojo::InterfaceRequest;
using ui::mojom::WindowServerTest;
-using ui::mojom::WindowTreeHostFactory;
namespace ui {
@@ -83,7 +82,6 @@ struct Service::PendingRequest {
struct Service::UserState {
std::unique_ptr<clipboard::ClipboardImpl> clipboard;
std::unique_ptr<ws::AccessibilityManager> accessibility;
- std::unique_ptr<ws::WindowTreeHostFactory> window_tree_host_factory;
};
Service::Service()
@@ -207,7 +205,7 @@ bool Service::OnConnect(const service_manager::ServiceInfo& remote_info,
registry->AddInterface<mojom::IMEServer>(this);
registry->AddInterface<mojom::UserAccessManager>(this);
registry->AddInterface<mojom::UserActivityMonitor>(this);
- registry->AddInterface<WindowTreeHostFactory>(this);
+ registry->AddInterface<mojom::WindowTreeHostFactoryRegistrar>(this);
registry->AddInterface<mojom::WindowManagerWindowTreeFactory>(this);
registry->AddInterface<mojom::WindowTreeFactory>(this);
registry
@@ -346,13 +344,11 @@ void Service::Create(const service_manager::Identity& remote_identity,
}
void Service::Create(const service_manager::Identity& remote_identity,
- mojom::WindowTreeHostFactoryRequest request) {
- UserState* user_state = GetUserState(remote_identity);
- if (!user_state->window_tree_host_factory) {
- user_state->window_tree_host_factory.reset(new ws::WindowTreeHostFactory(
- window_server_.get(), remote_identity.user_id()));
- }
- user_state->window_tree_host_factory->AddBinding(std::move(request));
+ mojom::WindowTreeHostFactoryRegistrarRequest request) {
+ AddUserIfNecessary(remote_identity);
+ mojo::MakeStrongBinding(base::MakeUnique<ws::WindowTreeHostFactoryRegistrar>(
+ window_server_.get(), remote_identity.user_id()),
+ std::move(request));
}
void Service::Create(

Powered by Google App Engine
This is Rietveld 408576698