| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 | 154 |
| 155 bool IsClientRoot(Window* window) { | 155 bool IsClientRoot(Window* window) { |
| 156 return window->window_tree() && | 156 return window->window_tree() && |
| 157 window->window_tree()->GetRoots().count(window) > 0; | 157 window->window_tree()->GetRoots().count(window) > 0; |
| 158 } | 158 } |
| 159 | 159 |
| 160 bool OwnsWindowOrIsRoot(Window* window) { | 160 bool OwnsWindowOrIsRoot(Window* window) { |
| 161 return OwnsWindow(window->window_tree(), window) || IsClientRoot(window); | 161 return OwnsWindow(window->window_tree(), window) || IsClientRoot(window); |
| 162 } | 162 } |
| 163 | 163 |
| 164 void EmptyEmbedCallback(bool result) {} | 164 void EmptyEmbedCallback(bool result, mojom::InputEventHandlerPtr handler) {} |
| 165 | 165 |
| 166 } // namespace | 166 } // namespace |
| 167 | 167 |
| 168 //////////////////////////////////////////////////////////////////////////////// | 168 //////////////////////////////////////////////////////////////////////////////// |
| 169 // Window, public: | 169 // Window, public: |
| 170 | 170 |
| 171 void Window::Destroy() { | 171 void Window::Destroy() { |
| 172 if (!OwnsWindowOrIsRoot(this)) | 172 if (!OwnsWindowOrIsRoot(this)) |
| 173 return; | 173 return; |
| 174 | 174 |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 void Window::Embed(mus::mojom::WindowTreeClientPtr client, uint32_t flags) { | 450 void Window::Embed(mus::mojom::WindowTreeClientPtr client, uint32_t flags) { |
| 451 Embed(std::move(client), base::Bind(&EmptyEmbedCallback), flags); | 451 Embed(std::move(client), base::Bind(&EmptyEmbedCallback), flags); |
| 452 } | 452 } |
| 453 | 453 |
| 454 void Window::Embed(mus::mojom::WindowTreeClientPtr client, | 454 void Window::Embed(mus::mojom::WindowTreeClientPtr client, |
| 455 const EmbedCallback& callback, | 455 const EmbedCallback& callback, |
| 456 uint32_t flags) { | 456 uint32_t flags) { |
| 457 if (PrepareForEmbed()) | 457 if (PrepareForEmbed()) |
| 458 client_->Embed(server_id_, std::move(client), flags, callback); | 458 client_->Embed(server_id_, std::move(client), flags, callback); |
| 459 else | 459 else |
| 460 callback.Run(false); | 460 callback.Run(false, nullptr); |
| 461 } | 461 } |
| 462 | 462 |
| 463 void Window::RequestClose() { | 463 void Window::RequestClose() { |
| 464 if (client_) | 464 if (client_) |
| 465 client_->RequestClose(this); | 465 client_->RequestClose(this); |
| 466 } | 466 } |
| 467 | 467 |
| 468 std::string Window::GetName() const { | 468 std::string Window::GetName() const { |
| 469 if (HasSharedProperty(mojom::WindowManager::kName_Property)) | 469 if (HasSharedProperty(mojom::WindowManager::kName_Property)) |
| 470 return GetSharedProperty<std::string>(mojom::WindowManager::kName_Property); | 470 return GetSharedProperty<std::string>(mojom::WindowManager::kName_Property); |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 notifier->NotifyWindowReordered(); | 882 notifier->NotifyWindowReordered(); |
| 883 | 883 |
| 884 return true; | 884 return true; |
| 885 } | 885 } |
| 886 | 886 |
| 887 // static | 887 // static |
| 888 Window** Window::GetStackingTarget(Window* window) { | 888 Window** Window::GetStackingTarget(Window* window) { |
| 889 return &window->stacking_target_; | 889 return &window->stacking_target_; |
| 890 } | 890 } |
| 891 } // namespace mus | 891 } // namespace mus |
| OLD | NEW |