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 "components/mus/public/cpp/window.h" | 5 #include "components/mus/public/cpp/window.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 LocalSetVisible(value); | 210 LocalSetVisible(value); |
211 } | 211 } |
212 | 212 |
213 bool Window::IsDrawn() const { | 213 bool Window::IsDrawn() const { |
214 if (!visible_) | 214 if (!visible_) |
215 return false; | 215 return false; |
216 return parent_ ? parent_->IsDrawn() : drawn_; | 216 return parent_ ? parent_->IsDrawn() : drawn_; |
217 } | 217 } |
218 | 218 |
219 scoped_ptr<WindowSurface> Window::RequestSurface(mojom::SurfaceType type) { | 219 scoped_ptr<WindowSurface> Window::RequestSurface(mojom::SurfaceType type) { |
220 mojom::SurfacePtr surface; | 220 scoped_ptr<WindowSurfaceBinding> surface_binding; |
221 mojom::SurfaceClientPtr client; | 221 scoped_ptr<WindowSurface> surface = WindowSurface::Create(&surface_binding); |
222 mojo::InterfaceRequest<mojom::SurfaceClient> client_request = | 222 AttachSurface(type, surface_binding.Pass()); |
223 GetProxy(&client); | 223 return surface; |
224 tree_client()->RequestSurface(id_, type, GetProxy(&surface), client.Pass()); | 224 } |
225 return make_scoped_ptr( | 225 |
226 new WindowSurface(surface.PassInterface(), client_request.Pass())); | 226 void Window::AttachSurface(mojom::SurfaceType type, |
| 227 scoped_ptr<WindowSurfaceBinding> surface_binding) { |
| 228 tree_client()->AttachSurface(id_, type, |
| 229 surface_binding->surface_request_.Pass(), |
| 230 surface_binding->surface_client_.Pass()); |
227 } | 231 } |
228 | 232 |
229 void Window::ClearSharedProperty(const std::string& name) { | 233 void Window::ClearSharedProperty(const std::string& name) { |
230 SetSharedPropertyInternal(name, nullptr); | 234 SetSharedPropertyInternal(name, nullptr); |
231 } | 235 } |
232 | 236 |
233 bool Window::HasSharedProperty(const std::string& name) const { | 237 bool Window::HasSharedProperty(const std::string& name) const { |
234 return properties_.count(name) > 0; | 238 return properties_.count(name) > 0; |
235 } | 239 } |
236 | 240 |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 notifier->NotifyWindowReordered(); | 770 notifier->NotifyWindowReordered(); |
767 | 771 |
768 return true; | 772 return true; |
769 } | 773 } |
770 | 774 |
771 // static | 775 // static |
772 Window** Window::GetStackingTarget(Window* window) { | 776 Window** Window::GetStackingTarget(Window* window) { |
773 return &window->stacking_target_; | 777 return &window->stacking_target_; |
774 } | 778 } |
775 } // namespace mus | 779 } // namespace mus |
OLD | NEW |