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

Side by Side Diff: ash/wm/dock/docked_window_resizer.cc

Issue 169713003: Remove WindowState::IsNormalShowState() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/wm/dock/docked_window_layout_manager_unittest.cc ('k') | ash/wm/dock/docked_window_resizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698