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

Unified Diff: mojo/services/view_manager/view_manager_service_impl.cc

Issue 707633005: Minor cleanup of ViewManagerServiceImpl (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « mojo/services/view_manager/view_manager_service_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/view_manager/view_manager_service_impl.cc
diff --git a/mojo/services/view_manager/view_manager_service_impl.cc b/mojo/services/view_manager/view_manager_service_impl.cc
index 07bf803c0f061311271bc45e4d081b5219bd746c..323d2dbe4d232a67f70bf857da9c5a6b474353cb 100644
--- a/mojo/services/view_manager/view_manager_service_impl.cc
+++ b/mojo/services/view_manager/view_manager_service_impl.cc
@@ -22,14 +22,12 @@ ViewManagerServiceImpl::ViewManagerServiceImpl(
ConnectionSpecificId creator_id,
const std::string& creator_url,
const std::string& url,
- const ViewId& root_id,
- InterfaceRequest<ServiceProvider> service_provider)
+ const ViewId& root_id)
: connection_manager_(connection_manager),
id_(connection_manager_->GetAndAdvanceNextConnectionId()),
url_(url),
creator_id_(creator_id),
- creator_url_(creator_url),
- service_provider_(service_provider.Pass()) {
+ creator_url_(creator_url) {
CHECK(GetView(root_id));
root_.reset(new ViewId(root_id));
if (root_id == RootViewId())
@@ -42,6 +40,22 @@ ViewManagerServiceImpl::~ViewManagerServiceImpl() {
DestroyViews();
}
+void ViewManagerServiceImpl::Init(
+ InterfaceRequest<ServiceProvider> service_provider) {
+ std::vector<const ServerView*> to_send;
+ if (root_.get())
+ GetUnknownViewsFrom(GetView(*root_), &to_send);
+
+ MessagePipe pipe;
+ connection_manager_->wm_internal()->CreateWindowManagerForViewManagerClient(
+ id_, pipe.handle1.Pass());
+ client()->OnEmbed(id_,
+ creator_url_,
+ ViewToViewData(to_send.front()),
+ service_provider.Pass(),
+ pipe.handle0.Pass());
+}
+
const ServerView* ViewManagerServiceImpl::GetView(const ViewId& id) const {
if (id_ == id.connection_id) {
ViewMap::const_iterator i = view_map_.find(id.view_id);
@@ -550,21 +564,6 @@ void ViewManagerServiceImpl::Embed(
callback.Run(true);
}
-void ViewManagerServiceImpl::OnConnectionEstablished() {
- std::vector<const ServerView*> to_send;
- if (root_.get())
- GetUnknownViewsFrom(GetView(*root_), &to_send);
-
- MessagePipe pipe;
- connection_manager_->wm_internal()->CreateWindowManagerForViewManagerClient(
- id_, pipe.handle1.Pass());
- client()->OnEmbed(id_,
- creator_url_,
- ViewToViewData(to_send.front()),
- service_provider_.Pass(),
- pipe.handle0.Pass());
-}
-
bool ViewManagerServiceImpl::IsRootForAccessPolicy(const ViewId& id) const {
return IsRoot(id);
}
« no previous file with comments | « mojo/services/view_manager/view_manager_service_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698