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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
370 static_cast<WindowTreeClientImpl*>(connection_) | 370 static_cast<WindowTreeClientImpl*>(connection_) |
371 ->SetShowState(id_, show_state); | 371 ->SetShowState(id_, show_state); |
372 } | 372 } |
373 | 373 |
374 void Window::SetResizeBehavior(mojom::ResizeBehavior resize_behavior) { | 374 void Window::SetResizeBehavior(mojom::ResizeBehavior resize_behavior) { |
375 if (connection_) | 375 if (connection_) |
376 static_cast<WindowTreeClientImpl*>(connection_) | 376 static_cast<WindowTreeClientImpl*>(connection_) |
377 ->SetResizeBehavior(id_, resize_behavior); | 377 ->SetResizeBehavior(id_, resize_behavior); |
378 } | 378 } |
379 | 379 |
380 void Window::SetCapture() { | |
381 if (connection_) | |
sky
2015/11/17 01:06:41
We should track capture locally too.
| |
382 static_cast<WindowTreeClientImpl*>(connection_)->SetCapture(this); | |
383 } | |
384 | |
385 void Window::ReleaseCapture() { | |
386 if (connection_) | |
387 static_cast<WindowTreeClientImpl*>(connection_)->ReleaseCapture(this); | |
388 } | |
389 | |
380 void Window::SetFocus() { | 390 void Window::SetFocus() { |
381 if (connection_) | 391 if (connection_) |
382 static_cast<WindowTreeClientImpl*>(connection_)->SetFocus(id_); | 392 static_cast<WindowTreeClientImpl*>(connection_)->SetFocus(id_); |
383 } | 393 } |
384 | 394 |
385 bool Window::HasFocus() const { | 395 bool Window::HasFocus() const { |
386 return connection_ && connection_->GetFocusedWindow() == this; | 396 return connection_ && connection_->GetFocusedWindow() == this; |
387 } | 397 } |
388 | 398 |
389 void Window::Embed(mus::mojom::WindowTreeClientPtr client) { | 399 void Window::Embed(mus::mojom::WindowTreeClientPtr client) { |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
795 notifier->NotifyWindowReordered(); | 805 notifier->NotifyWindowReordered(); |
796 | 806 |
797 return true; | 807 return true; |
798 } | 808 } |
799 | 809 |
800 // static | 810 // static |
801 Window** Window::GetStackingTarget(Window* window) { | 811 Window** Window::GetStackingTarget(Window* window) { |
802 return &window->stacking_target_; | 812 return &window->stacking_target_; |
803 } | 813 } |
804 } // namespace mus | 814 } // namespace mus |
OLD | NEW |