OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h" | 5 #include "mojo/services/public/cpp/view_manager/lib/view_manager_client_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "mojo/public/cpp/application/application_impl.h" | 10 #include "mojo/public/cpp/application/application_impl.h" |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 | 86 |
87 View* root_; | 87 View* root_; |
88 | 88 |
89 DISALLOW_COPY_AND_ASSIGN(RootObserver); | 89 DISALLOW_COPY_AND_ASSIGN(RootObserver); |
90 }; | 90 }; |
91 | 91 |
92 ViewManagerClientImpl::ViewManagerClientImpl(ViewManagerDelegate* delegate, | 92 ViewManagerClientImpl::ViewManagerClientImpl(ViewManagerDelegate* delegate, |
93 Shell* shell) | 93 Shell* shell) |
94 : connected_(false), connection_id_(0), next_id_(1), delegate_(delegate) { | 94 : connected_(false), connection_id_(0), next_id_(1), delegate_(delegate) { |
95 InterfacePtr<ServiceProvider> sp; | 95 InterfacePtr<ServiceProvider> sp; |
96 shell->ConnectToApplication("mojo:mojo_window_manager", GetProxy(&sp)); | 96 shell->ConnectToApplication("mojo:window_manager", GetProxy(&sp)); |
97 ConnectToService(sp.get(), &window_manager_); | 97 ConnectToService(sp.get(), &window_manager_); |
98 window_manager_.set_client(this); | 98 window_manager_.set_client(this); |
99 } | 99 } |
100 | 100 |
101 ViewManagerClientImpl::~ViewManagerClientImpl() { | 101 ViewManagerClientImpl::~ViewManagerClientImpl() { |
102 std::vector<View*> non_owned; | 102 std::vector<View*> non_owned; |
103 while (!views_.empty()) { | 103 while (!views_.empty()) { |
104 IdToViewMap::iterator it = views_.begin(); | 104 IdToViewMap::iterator it = views_.begin(); |
105 if (OwnsView(it->second->id())) { | 105 if (OwnsView(it->second->id())) { |
106 it->second->Destroy(); | 106 it->second->Destroy(); |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 base::Unretained(this)); | 378 base::Unretained(this)); |
379 } | 379 } |
380 | 380 |
381 base::Callback<void(ErrorCode)> | 381 base::Callback<void(ErrorCode)> |
382 ViewManagerClientImpl::ActionCompletedCallbackWithErrorCode() { | 382 ViewManagerClientImpl::ActionCompletedCallbackWithErrorCode() { |
383 return base::Bind(&ViewManagerClientImpl::OnActionCompletedWithErrorCode, | 383 return base::Bind(&ViewManagerClientImpl::OnActionCompletedWithErrorCode, |
384 base::Unretained(this)); | 384 base::Unretained(this)); |
385 } | 385 } |
386 | 386 |
387 } // namespace mojo | 387 } // namespace mojo |
OLD | NEW |