| 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/lib/window_tree_client_impl.h" | 5 #include "components/mus/public/cpp/lib/window_tree_client_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 | 517 |
| 518 Window* WindowTreeClientImpl::GetWindowById(Id id) { | 518 Window* WindowTreeClientImpl::GetWindowById(Id id) { |
| 519 IdToWindowMap::const_iterator it = windows_.find(id); | 519 IdToWindowMap::const_iterator it = windows_.find(id); |
| 520 return it != windows_.end() ? it->second : NULL; | 520 return it != windows_.end() ? it->second : NULL; |
| 521 } | 521 } |
| 522 | 522 |
| 523 Window* WindowTreeClientImpl::GetFocusedWindow() { | 523 Window* WindowTreeClientImpl::GetFocusedWindow() { |
| 524 return focused_window_; | 524 return focused_window_; |
| 525 } | 525 } |
| 526 | 526 |
| 527 void WindowTreeClientImpl::ClearFocus() { |
| 528 if (!focused_window_) |
| 529 return; |
| 530 |
| 531 SetFocus(nullptr); |
| 532 } |
| 533 |
| 527 Window* WindowTreeClientImpl::NewWindow( | 534 Window* WindowTreeClientImpl::NewWindow( |
| 528 const Window::SharedProperties* properties) { | 535 const Window::SharedProperties* properties) { |
| 529 return NewWindowImpl(NewWindowType::CHILD, properties); | 536 return NewWindowImpl(NewWindowType::CHILD, properties); |
| 530 } | 537 } |
| 531 | 538 |
| 532 Window* WindowTreeClientImpl::NewTopLevelWindow( | 539 Window* WindowTreeClientImpl::NewTopLevelWindow( |
| 533 const Window::SharedProperties* properties) { | 540 const Window::SharedProperties* properties) { |
| 534 return NewWindowImpl(NewWindowType::TOP_LEVEL, properties); | 541 return NewWindowImpl(NewWindowType::TOP_LEVEL, properties); |
| 535 } | 542 } |
| 536 | 543 |
| (...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 | 990 |
| 984 void WindowTreeClientImpl::SetUnderlaySurfaceOffsetAndExtendedHitArea( | 991 void WindowTreeClientImpl::SetUnderlaySurfaceOffsetAndExtendedHitArea( |
| 985 Window* window, | 992 Window* window, |
| 986 const gfx::Vector2d& offset, | 993 const gfx::Vector2d& offset, |
| 987 const gfx::Insets& hit_area) { | 994 const gfx::Insets& hit_area) { |
| 988 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( | 995 window_manager_internal_client_->SetUnderlaySurfaceOffsetAndExtendedHitArea( |
| 989 window->id(), offset.x(), offset.y(), mojo::Insets::From(hit_area)); | 996 window->id(), offset.x(), offset.y(), mojo::Insets::From(hit_area)); |
| 990 } | 997 } |
| 991 | 998 |
| 992 } // namespace mus | 999 } // namespace mus |
| OLD | NEW |