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

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

Issue 2761383002: Fix the error message in ui::ws::WindowTree::StackAbove method (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | no next file » | 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 1644 matching lines...) Expand 10 before | Expand all | Expand 10 after
1655 } 1655 }
1656 1656
1657 WindowTree* wm_tree = display_root->window_manager_state()->window_tree(); 1657 WindowTree* wm_tree = display_root->window_manager_state()->window_tree();
1658 wm_tree->window_manager_internal_->WmDeactivateWindow( 1658 wm_tree->window_manager_internal_->WmDeactivateWindow(
1659 wm_tree->ClientWindowIdForWindow(window).id); 1659 wm_tree->ClientWindowIdForWindow(window).id);
1660 } 1660 }
1661 1661
1662 void WindowTree::StackAbove(uint32_t change_id, Id above_id, Id below_id) { 1662 void WindowTree::StackAbove(uint32_t change_id, Id above_id, Id below_id) {
1663 ServerWindow* above = GetWindowByClientId(ClientWindowId(above_id)); 1663 ServerWindow* above = GetWindowByClientId(ClientWindowId(above_id));
1664 if (!above) { 1664 if (!above) {
1665 DVLOG(1) << "StackAtTop failed (invalid above id)"; 1665 DVLOG(1) << "StackAbove failed (invalid above id)";
1666 client()->OnChangeCompleted(change_id, false); 1666 client()->OnChangeCompleted(change_id, false);
1667 return; 1667 return;
1668 } 1668 }
1669 1669
1670 ServerWindow* below = GetWindowByClientId(ClientWindowId(below_id)); 1670 ServerWindow* below = GetWindowByClientId(ClientWindowId(below_id));
1671 if (!below) { 1671 if (!below) {
1672 DVLOG(1) << "StackAtTop failed (invalid below id)"; 1672 DVLOG(1) << "StackAbove failed (invalid below id)";
1673 client()->OnChangeCompleted(change_id, false); 1673 client()->OnChangeCompleted(change_id, false);
1674 return; 1674 return;
1675 } 1675 }
1676 1676
1677 if (!access_policy_->CanStackAbove(above, below)) { 1677 if (!access_policy_->CanStackAbove(above, below)) {
1678 DVLOG(1) << "StackAtTop failed (access denied)"; 1678 DVLOG(1) << "StackAbove failed (access denied)";
1679 client()->OnChangeCompleted(change_id, false); 1679 client()->OnChangeCompleted(change_id, false);
1680 return; 1680 return;
1681 } 1681 }
1682 1682
1683 ServerWindow* parent = above->parent(); 1683 ServerWindow* parent = above->parent();
1684 ServerWindow* below_parent = below->parent(); 1684 ServerWindow* below_parent = below->parent();
1685 if (!parent) { 1685 if (!parent) {
1686 DVLOG(1) << "StackAtTop failed (above unparented)"; 1686 DVLOG(1) << "StackAbove failed (above unparented)";
1687 client()->OnChangeCompleted(change_id, false); 1687 client()->OnChangeCompleted(change_id, false);
1688 return; 1688 return;
1689 } 1689 }
1690 if (!below_parent) { 1690 if (!below_parent) {
1691 DVLOG(1) << "StackAtTop failed (below unparented)"; 1691 DVLOG(1) << "StackAbove failed (below unparented)";
1692 client()->OnChangeCompleted(change_id, false); 1692 client()->OnChangeCompleted(change_id, false);
1693 return; 1693 return;
1694 } 1694 }
1695 if (parent != below_parent) { 1695 if (parent != below_parent) {
1696 DVLOG(1) << "StackAtTop failed (windows have different parents)"; 1696 DVLOG(1) << "StackAbove failed (windows have different parents)";
1697 client()->OnChangeCompleted(change_id, false); 1697 client()->OnChangeCompleted(change_id, false);
1698 return; 1698 return;
1699 } 1699 }
1700 1700
1701 WindowManagerDisplayRoot* display_root = GetWindowManagerDisplayRoot(above); 1701 WindowManagerDisplayRoot* display_root = GetWindowManagerDisplayRoot(above);
1702 if (!display_root) { 1702 if (!display_root) {
1703 DVLOG(1) << "StackAtTop (no display root)"; 1703 DVLOG(1) << "StackAbove (no display root)";
1704 client()->OnChangeCompleted(change_id, false); 1704 client()->OnChangeCompleted(change_id, false);
1705 return; 1705 return;
1706 } 1706 }
1707 1707
1708 // Window reordering assumes that it is the owner of parent who is sending 1708 // Window reordering assumes that it is the owner of parent who is sending
1709 // the message, and does not deal gracefully with other clients reordering 1709 // the message, and does not deal gracefully with other clients reordering
1710 // their windows. So tell the window manager to send us a reorder message. 1710 // their windows. So tell the window manager to send us a reorder message.
1711 WindowTree* wm_tree = display_root->window_manager_state()->window_tree(); 1711 WindowTree* wm_tree = display_root->window_manager_state()->window_tree();
1712 const uint32_t wm_change_id = 1712 const uint32_t wm_change_id =
1713 window_server_->GenerateWindowManagerChangeId(this, change_id); 1713 window_server_->GenerateWindowManagerChangeId(this, change_id);
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
2206 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset, 2206 client()->OnCompleteDrop(client_window_id.id, event_flags, cursor_offset,
2207 effect_bitmask, callback); 2207 effect_bitmask, callback);
2208 } 2208 }
2209 2209
2210 void WindowTree::PerformOnDragDropDone() { 2210 void WindowTree::PerformOnDragDropDone() {
2211 client()->OnDragDropDone(); 2211 client()->OnDragDropDone();
2212 } 2212 }
2213 2213
2214 } // namespace ws 2214 } // namespace ws
2215 } // namespace ui 2215 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698