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

Side by Side Diff: services/ui/ws/window_tree.cc

Issue 2557353003: Changes OnWindowHierarchyChanged() to include transient parent (Closed)
Patch Set: fix Created 4 years 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 | « services/ui/ws/window_manager_client_unittest.cc ('k') | ui/aura/mus/window_tree_client.h » ('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 "services/ui/ws/window_tree.h" 5 #include "services/ui/ws/window_tree.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 std::vector<mojom::WindowDataPtr> array(windows.size()); 1007 std::vector<mojom::WindowDataPtr> array(windows.size());
1008 for (size_t i = 0; i < windows.size(); ++i) 1008 for (size_t i = 0; i < windows.size(); ++i)
1009 array[i] = WindowToWindowData(windows[i]); 1009 array[i] = WindowToWindowData(windows[i]);
1010 return array; 1010 return array;
1011 } 1011 }
1012 1012
1013 mojom::WindowDataPtr WindowTree::WindowToWindowData( 1013 mojom::WindowDataPtr WindowTree::WindowToWindowData(
1014 const ServerWindow* window) { 1014 const ServerWindow* window) {
1015 DCHECK(IsWindowKnown(window)); 1015 DCHECK(IsWindowKnown(window));
1016 const ServerWindow* parent = window->parent(); 1016 const ServerWindow* parent = window->parent();
1017 // If the parent isn't known, it means the parent is not visible to us (not 1017 const ServerWindow* transient_parent = window->transient_parent();
1018 // in roots), and should not be sent over. 1018 // If the parent or transient parent isn't known, it means it is not visible
1019 if (parent && !IsWindowKnown(parent)) 1019 // to the client and should not be sent over.
1020 if (!IsWindowKnown(parent))
1020 parent = nullptr; 1021 parent = nullptr;
1022 if (!IsWindowKnown(transient_parent))
1023 transient_parent = nullptr;
1021 mojom::WindowDataPtr window_data(mojom::WindowData::New()); 1024 mojom::WindowDataPtr window_data(mojom::WindowData::New());
1022 window_data->parent_id = 1025 window_data->parent_id =
1023 parent ? ClientWindowIdForWindow(parent).id : ClientWindowId().id; 1026 parent ? ClientWindowIdForWindow(parent).id : ClientWindowId().id;
1024 window_data->window_id = 1027 window_data->window_id =
1025 window ? ClientWindowIdForWindow(window).id : ClientWindowId().id; 1028 window ? ClientWindowIdForWindow(window).id : ClientWindowId().id;
1029 window_data->transient_parent_id =
1030 transient_parent ? ClientWindowIdForWindow(transient_parent).id
1031 : ClientWindowId().id;
1026 window_data->bounds = window->bounds(); 1032 window_data->bounds = window->bounds();
1027 window_data->properties = mojo::MapToUnorderedMap(window->properties()); 1033 window_data->properties = mojo::MapToUnorderedMap(window->properties());
1028 window_data->visible = window->visible(); 1034 window_data->visible = window->visible();
1029 return window_data; 1035 return window_data;
1030 } 1036 }
1031 1037
1032 void WindowTree::GetWindowTreeImpl( 1038 void WindowTree::GetWindowTreeImpl(
1033 const ServerWindow* window, 1039 const ServerWindow* window,
1034 std::vector<const ServerWindow*>* windows) const { 1040 std::vector<const ServerWindow*>* windows) const {
1035 DCHECK(window); 1041 DCHECK(window);
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after
1989 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, 1995 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset,
1990 effect_bitmask, callback); 1996 effect_bitmask, callback);
1991 } 1997 }
1992 1998
1993 void WindowTree::PerformOnDragDropDone() { 1999 void WindowTree::PerformOnDragDropDone() {
1994 client()->OnDragDropDone(); 2000 client()->OnDragDropDone();
1995 } 2001 }
1996 2002
1997 } // namespace ws 2003 } // namespace ws
1998 } // namespace ui 2004 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/window_manager_client_unittest.cc ('k') | ui/aura/mus/window_tree_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698