Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Side by Side Diff: components/mus/public/cpp/lib/window_tree_client_impl.cc

Issue 1862853002: Makes WindowTree::SetFocus(null) work (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moar cleanup Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « components/mus/public/cpp/lib/window_tree_client_impl.h ('k') | components/mus/public/cpp/window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698