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

Side by Side Diff: ash/wm/workspace/workspace_window_resizer.cc

Issue 597683003: Add window states docked; and docked minimized. Add wm window event to set docked and undocked. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dock
Patch Set: Pull forward a change from the dependant CL to this Created 6 years, 2 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 | « ash/wm/wm_types.cc ('k') | 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/wm/workspace/workspace_window_resizer.h" 5 #include "ash/wm/workspace/workspace_window_resizer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // implement proper transition from one resizer to another during or at the 65 // implement proper transition from one resizer to another during or at the
66 // end of the drag. This also causes http://crbug.com/247085. 66 // end of the drag. This also causes http://crbug.com/247085.
67 // It seems the only thing the panel or dock resizer needs to do is notify the 67 // It seems the only thing the panel or dock resizer needs to do is notify the
68 // layout manager when a docked window is being dragged. We should have a 68 // layout manager when a docked window is being dragged. We should have a
69 // better way of doing this, perhaps by having a way of observing drags or 69 // better way of doing this, perhaps by having a way of observing drags or
70 // having a generic drag window wrapper which informs a layout manager that a 70 // having a generic drag window wrapper which informs a layout manager that a
71 // drag has started or stopped. 71 // drag has started or stopped.
72 // It may be possible to refactor and eliminate chaining. 72 // It may be possible to refactor and eliminate chaining.
73 WindowResizer* window_resizer = NULL; 73 WindowResizer* window_resizer = NULL;
74 74
75 if (!window_state->IsNormalOrSnapped()) 75 if (!window_state->IsNormalOrSnapped() && !window_state->IsDocked())
76 return scoped_ptr<WindowResizer>(); 76 return scoped_ptr<WindowResizer>();
77 77
78 int bounds_change = WindowResizer::GetBoundsChangeForWindowComponent( 78 int bounds_change = WindowResizer::GetBoundsChangeForWindowComponent(
79 window_component); 79 window_component);
80 if (bounds_change == WindowResizer::kBoundsChangeDirection_None) 80 if (bounds_change == WindowResizer::kBoundsChangeDirection_None)
81 return scoped_ptr<WindowResizer>(); 81 return scoped_ptr<WindowResizer>();
82 82
83 window_state->CreateDragDetails(window, point_in_parent, window_component, 83 window_state->CreateDragDetails(window, point_in_parent, window_component,
84 source); 84 source);
85 if (window->parent() && 85 if (window->parent() &&
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED); 1050 snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED);
1051 gfx::Rect snapped_bounds = ScreenUtil::GetDisplayWorkAreaBoundsInParent( 1051 gfx::Rect snapped_bounds = ScreenUtil::GetDisplayWorkAreaBoundsInParent(
1052 GetTarget()); 1052 GetTarget());
1053 if (snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED) 1053 if (snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED)
1054 snapped_bounds.set_x(snapped_bounds.right() - bounds_in_parent.width()); 1054 snapped_bounds.set_x(snapped_bounds.right() - bounds_in_parent.width());
1055 snapped_bounds.set_width(bounds_in_parent.width()); 1055 snapped_bounds.set_width(bounds_in_parent.width());
1056 return bounds_in_parent == snapped_bounds; 1056 return bounds_in_parent == snapped_bounds;
1057 } 1057 }
1058 1058
1059 } // namespace ash 1059 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/wm_types.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698