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

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

Issue 101773004: Refactor PhantomWindowController so that the PhantomWindowController owns the phantom window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 (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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 // This way we don't snap on resize. 554 // This way we don't snap on resize.
555 int min_size = std::min(initial_size, 555 int min_size = std::min(initial_size,
556 std::max(PrimaryAxisSize(min), kMinOnscreenSize)); 556 std::max(PrimaryAxisSize(min), kMinOnscreenSize));
557 total_min_ += min_size; 557 total_min_ += min_size;
558 total_initial_size_ += initial_size; 558 total_initial_size_ += initial_size;
559 total_available += std::max(min_size, initial_size) - min_size; 559 total_available += std::max(min_size, initial_size) - min_size;
560 } 560 }
561 instance_ = this; 561 instance_ = this;
562 } 562 }
563 563
564 gfx::Rect WorkspaceWindowResizer::GetFinalBounds(
565 const gfx::Rect& bounds) const {
566 if (snap_phantom_window_controller_.get() &&
567 snap_phantom_window_controller_->IsShowing()) {
568 return snap_phantom_window_controller_->bounds_in_screen();
569 }
570 return bounds;
571 }
572
573 void WorkspaceWindowResizer::LayoutAttachedWindows( 564 void WorkspaceWindowResizer::LayoutAttachedWindows(
574 gfx::Rect* bounds) { 565 gfx::Rect* bounds) {
575 gfx::Rect work_area(ScreenAsh::GetDisplayWorkAreaBoundsInParent(window())); 566 gfx::Rect work_area(ScreenAsh::GetDisplayWorkAreaBoundsInParent(window()));
576 int initial_size = PrimaryAxisSize(details_.initial_bounds_in_parent.size()); 567 int initial_size = PrimaryAxisSize(details_.initial_bounds_in_parent.size());
577 int current_size = PrimaryAxisSize(bounds->size()); 568 int current_size = PrimaryAxisSize(bounds->size());
578 int start = PrimaryAxisCoordinate(bounds->right(), bounds->bottom()); 569 int start = PrimaryAxisCoordinate(bounds->right(), bounds->bottom());
579 int end = PrimaryAxisCoordinate(work_area.right(), work_area.bottom()); 570 int end = PrimaryAxisCoordinate(work_area.right(), work_area.bottom());
580 571
581 int delta = current_size - initial_size; 572 int delta = current_size - initial_size;
582 int available_size = end - start; 573 int available_size = end - start;
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
1042 } else { 1033 } else {
1043 if (dock_layout_->is_dragged_window_docked()) { 1034 if (dock_layout_->is_dragged_window_docked()) {
1044 dock_layout_->UndockDraggedWindow(); 1035 dock_layout_->UndockDraggedWindow();
1045 window_state()->set_bounds_changed_by_user(true); 1036 window_state()->set_bounds_changed_by_user(true);
1046 } 1037 }
1047 } 1038 }
1048 } 1039 }
1049 1040
1050 } // namespace internal 1041 } // namespace internal
1051 } // namespace ash 1042 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer.h ('k') | ash/wm/workspace/workspace_window_resizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698