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

Side by Side Diff: ash/wm/window_resizer.cc

Issue 2901663003: chromeos: converts WindowState to aura::Window (Closed)
Patch Set: feedback Created 3 years, 7 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/panels/panel_layout_manager.cc ('k') | ash/wm/window_state.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 (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/window_resizer.h" 5 #include "ash/wm/window_resizer.h"
6 6
7 #include "ash/wm/root_window_finder.h" 7 #include "ash/wm/root_window_finder.h"
8 #include "ash/wm/window_positioning_utils.h" 8 #include "ash/wm/window_positioning_utils.h"
9 #include "ash/wm/window_state.h" 9 #include "ash/wm/window_state.h"
10 #include "ash/wm_window.h" 10 #include "ash/wm_window.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 case HTLEFT: 100 case HTLEFT:
101 pos_change_direction |= WindowResizer::kBoundsChangeDirection_Horizontal; 101 pos_change_direction |= WindowResizer::kBoundsChangeDirection_Horizontal;
102 break; 102 break;
103 default: 103 default:
104 break; 104 break;
105 } 105 }
106 return pos_change_direction; 106 return pos_change_direction;
107 } 107 }
108 108
109 aura::Window* WindowResizer::GetTarget() const { 109 aura::Window* WindowResizer::GetTarget() const {
110 return window_state_ ? window_state_->window()->aura_window() : nullptr; 110 return window_state_ ? window_state_->window() : nullptr;
111 } 111 }
112 112
113 gfx::Rect WindowResizer::CalculateBoundsForDrag( 113 gfx::Rect WindowResizer::CalculateBoundsForDrag(
114 const gfx::Point& passed_location) { 114 const gfx::Point& passed_location) {
115 if (!details().is_resizable) 115 if (!details().is_resizable)
116 return details().initial_bounds_in_parent; 116 return details().initial_bounds_in_parent;
117 117
118 gfx::Point location = passed_location; 118 gfx::Point location = passed_location;
119 int delta_x = location.x() - details().initial_location_in_parent.x(); 119 int delta_x = location.x() - details().initial_location_in_parent.x();
120 int delta_y = location.y() - details().initial_location_in_parent.y(); 120 int delta_y = location.y() - details().initial_location_in_parent.y();
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 if (height > max_height) { 334 if (height > max_height) {
335 height = max_height; 335 height = max_height;
336 *delta_y = -y_multiplier * 336 *delta_y = -y_multiplier *
337 (details().initial_bounds_in_parent.height() - max_height); 337 (details().initial_bounds_in_parent.height() - max_height);
338 } 338 }
339 } 339 }
340 return height; 340 return height;
341 } 341 }
342 342
343 } // namespace ash 343 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/panels/panel_layout_manager.cc ('k') | ash/wm/window_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698