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

Side by Side Diff: components/mus/ws/window_tree_impl.cc

Issue 1423133003: Routes calls to WM through WS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no braces Created 5 years, 1 month 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
« no previous file with comments | « components/mus/ws/window_tree_impl.h ('k') | components/mus/ws/window_tree_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ws/window_tree_impl.h" 5 #include "components/mus/ws/window_tree_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "components/mus/ws/connection_manager.h" 9 #include "components/mus/ws/connection_manager.h"
10 #include "components/mus/ws/default_access_policy.h" 10 #include "components/mus/ws/default_access_policy.h"
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 // TODO(beng): consider shifting non-policy drawn check logic to VTH's 705 // TODO(beng): consider shifting non-policy drawn check logic to VTH's
706 // FocusController. 706 // FocusController.
707 if (window && window->IsDrawn() && access_policy_->CanSetFocus(window)) { 707 if (window && window->IsDrawn() && access_policy_->CanSetFocus(window)) {
708 ConnectionManager::ScopedChange change(this, connection_manager_, false); 708 ConnectionManager::ScopedChange change(this, connection_manager_, false);
709 WindowTreeHostImpl* host = GetHost(); 709 WindowTreeHostImpl* host = GetHost();
710 if (host) 710 if (host)
711 host->SetFocusedWindow(window); 711 host->SetFocusedWindow(window);
712 } 712 }
713 } 713 }
714 714
715 void WindowTreeImpl::SetPreferredSize(
716 uint32_t window_id,
717 mojo::SizePtr size,
718 const SetPreferredSizeCallback& callback) {
719 if (!GetHost() || !GetHost()->window_manager())
720 return;
721
722 // TODO(sky): verify window_id is valid for the client.
723 GetHost()->window_manager()->SetPreferredSize(window_id, size.Pass(),
724 callback);
725 }
726
727 void WindowTreeImpl::SetBounds(uint32_t window_id,
728 mojo::RectPtr bounds,
729 const SetBoundsCallback& callback) {
730 if (!GetHost() || !GetHost()->window_manager())
731 return;
732
733 // TODO(sky): verify window_id is valid for the client.
734 GetHost()->window_manager()->SetBounds(window_id, bounds.Pass(), callback);
735 }
736
737 void WindowTreeImpl::SetShowState(uint32_t window_id,
738 mojom::ShowState show_state,
739 const SetShowStateCallback& callback) {
740 if (!GetHost() || !GetHost()->window_manager())
741 return;
742
743 // TODO(sky): verify window_id is valid for the client.
744 GetHost()->window_manager()->SetShowState(window_id, show_state, callback);
745 }
746
747 void WindowTreeImpl::GetDisplays(const GetDisplaysCallback& callback) {
748 if (!GetHost() || !GetHost()->window_manager())
749 return;
750
751 GetHost()->window_manager()->GetDisplays(callback);
752 }
753
715 bool WindowTreeImpl::IsRootForAccessPolicy(const WindowId& id) const { 754 bool WindowTreeImpl::IsRootForAccessPolicy(const WindowId& id) const {
716 return IsRoot(id); 755 return IsRoot(id);
717 } 756 }
718 757
719 bool WindowTreeImpl::IsWindowKnownForAccessPolicy( 758 bool WindowTreeImpl::IsWindowKnownForAccessPolicy(
720 const ServerWindow* window) const { 759 const ServerWindow* window) const {
721 return IsWindowKnown(window); 760 return IsWindowKnown(window);
722 } 761 }
723 762
724 bool WindowTreeImpl::IsWindowRootOfAnotherConnectionForAccessPolicy( 763 bool WindowTreeImpl::IsWindowRootOfAnotherConnectionForAccessPolicy(
725 const ServerWindow* window) const { 764 const ServerWindow* window) const {
726 WindowTreeImpl* connection = 765 WindowTreeImpl* connection =
727 connection_manager_->GetConnectionWithRoot(window->id()); 766 connection_manager_->GetConnectionWithRoot(window->id());
728 return connection && connection != this; 767 return connection && connection != this;
729 } 768 }
730 769
731 bool WindowTreeImpl::IsDescendantOfEmbedRoot(const ServerWindow* window) { 770 bool WindowTreeImpl::IsDescendantOfEmbedRoot(const ServerWindow* window) {
732 return is_embed_root_ && root_ && GetWindow(*root_)->Contains(window); 771 return is_embed_root_ && root_ && GetWindow(*root_)->Contains(window);
733 } 772 }
734 773
735 } // namespace ws 774 } // namespace ws
736 775
737 } // namespace mus 776 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/ws/window_tree_impl.h ('k') | components/mus/ws/window_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698