OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/dock/docked_window_resizer.h" | 5 #include "ash/wm/dock/docked_window_resizer.h" |
6 | 6 |
7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/screen_util.h" | 9 #include "ash/screen_util.h" |
10 #include "ash/shelf/shelf.h" | 10 #include "ash/shelf/shelf.h" |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 did_move_or_resize_ = false; | 220 did_move_or_resize_ = false; |
221 aura::Window* window = GetTarget(); | 221 aura::Window* window = GetTarget(); |
222 const bool is_attached_panel = window->type() == ui::wm::WINDOW_TYPE_PANEL && | 222 const bool is_attached_panel = window->type() == ui::wm::WINDOW_TYPE_PANEL && |
223 window_state_->panel_attached(); | 223 window_state_->panel_attached(); |
224 const bool is_resized = | 224 const bool is_resized = |
225 (details().bounds_change & WindowResizer::kBoundsChange_Resizes) != 0; | 225 (details().bounds_change & WindowResizer::kBoundsChange_Resizes) != 0; |
226 | 226 |
227 // Undock the window if it is not in the normal or minimized show type. This | 227 // Undock the window if it is not in the normal or minimized show type. This |
228 // happens if a user snaps or maximizes a window using a keyboard shortcut | 228 // happens if a user snaps or maximizes a window using a keyboard shortcut |
229 // while it is being dragged. | 229 // while it is being dragged. |
230 if (window_state_->IsSnapped()) { | 230 if (!window_state_->IsMinimized() && !window_state_->IsNormalShowType()) |
231 is_docked_ = false; | 231 is_docked_ = false; |
232 } else if (!window_state_->IsMinimized() && | |
233 !window_state_->IsNormalShowState()) { | |
234 is_docked_ = false; | |
235 } | |
236 | 232 |
237 // When drag is completed the dragged docked window is resized to the bounds | 233 // When drag is completed the dragged docked window is resized to the bounds |
238 // calculated by the layout manager that conform to other docked windows. | 234 // calculated by the layout manager that conform to other docked windows. |
239 if (!is_attached_panel && is_docked_ && !is_resized) { | 235 if (!is_attached_panel && is_docked_ && !is_resized) { |
240 gfx::Rect bounds = ScreenUtil::ConvertRectFromScreen( | 236 gfx::Rect bounds = ScreenUtil::ConvertRectFromScreen( |
241 window->parent(), dock_layout_->dragged_bounds()); | 237 window->parent(), dock_layout_->dragged_bounds()); |
242 if (!bounds.IsEmpty() && bounds.width() != window->bounds().width()) { | 238 if (!bounds.IsEmpty() && bounds.width() != window->bounds().width()) { |
243 window->SetBounds(bounds); | 239 window->SetBounds(bounds); |
244 } | 240 } |
245 } | 241 } |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 // before. | 318 // before. |
323 if (is_docked_) { | 319 if (is_docked_) { |
324 wm::GetWindowState(window)->set_bounds_changed_by_user( | 320 wm::GetWindowState(window)->set_bounds_changed_by_user( |
325 was_docked_ && (is_resized || was_bounds_changed_by_user_)); | 321 was_docked_ && (is_resized || was_bounds_changed_by_user_)); |
326 } | 322 } |
327 return action; | 323 return action; |
328 } | 324 } |
329 | 325 |
330 } // namespace internal | 326 } // namespace internal |
331 } // namespace ash | 327 } // namespace ash |
OLD | NEW |