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

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

Issue 2814243002: Removes a couple more functions from WmWindow (Closed)
Patch Set: feedback Created 3 years, 8 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/workspace/workspace_layout_manager.cc ('k') | ash/wm/workspace_controller.cc » ('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/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 if (!window_state->IsNormalOrSnapped()) 65 if (!window_state->IsNormalOrSnapped())
66 return std::unique_ptr<WindowResizer>(); 66 return std::unique_ptr<WindowResizer>();
67 67
68 int bounds_change = 68 int bounds_change =
69 WindowResizer::GetBoundsChangeForWindowComponent(window_component); 69 WindowResizer::GetBoundsChangeForWindowComponent(window_component);
70 if (bounds_change == WindowResizer::kBoundsChangeDirection_None) 70 if (bounds_change == WindowResizer::kBoundsChangeDirection_None)
71 return std::unique_ptr<WindowResizer>(); 71 return std::unique_ptr<WindowResizer>();
72 72
73 window_state->CreateDragDetails(point_in_parent, window_component, source); 73 window_state->CreateDragDetails(point_in_parent, window_component, source);
74 const int parent_shell_window_id = 74 const int parent_shell_window_id =
75 window->GetParent() ? window->GetParent()->GetShellWindowId() : -1; 75 window->GetParent() ? window->GetParent()->aura_window()->id() : -1;
76 if (window->GetParent() && 76 if (window->GetParent() &&
77 (parent_shell_window_id == kShellWindowId_DefaultContainer || 77 (parent_shell_window_id == kShellWindowId_DefaultContainer ||
78 parent_shell_window_id == kShellWindowId_PanelContainer)) { 78 parent_shell_window_id == kShellWindowId_PanelContainer)) {
79 window_resizer.reset( 79 window_resizer.reset(
80 WorkspaceWindowResizer::Create(window_state, std::vector<WmWindow*>())); 80 WorkspaceWindowResizer::Create(window_state, std::vector<WmWindow*>()));
81 } else { 81 } else {
82 window_resizer.reset(DefaultWindowResizer::Create(window_state)); 82 window_resizer.reset(DefaultWindowResizer::Create(window_state));
83 } 83 }
84 window_resizer = ShellPort::Get()->CreateDragWindowResizer( 84 window_resizer = ShellPort::Get()->CreateDragWindowResizer(
85 std::move(window_resizer), window_state); 85 std::move(window_resizer), window_state);
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after
948 DCHECK(snapped_type == wm::WINDOW_STATE_TYPE_LEFT_SNAPPED || 948 DCHECK(snapped_type == wm::WINDOW_STATE_TYPE_LEFT_SNAPPED ||
949 snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED); 949 snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED);
950 gfx::Rect snapped_bounds = wm::GetDisplayWorkAreaBoundsInParent(GetTarget()); 950 gfx::Rect snapped_bounds = wm::GetDisplayWorkAreaBoundsInParent(GetTarget());
951 if (snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED) 951 if (snapped_type == wm::WINDOW_STATE_TYPE_RIGHT_SNAPPED)
952 snapped_bounds.set_x(snapped_bounds.right() - bounds_in_parent.width()); 952 snapped_bounds.set_x(snapped_bounds.right() - bounds_in_parent.width());
953 snapped_bounds.set_width(bounds_in_parent.width()); 953 snapped_bounds.set_width(bounds_in_parent.width());
954 return bounds_in_parent == snapped_bounds; 954 return bounds_in_parent == snapped_bounds;
955 } 955 }
956 956
957 } // namespace ash 957 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_layout_manager.cc ('k') | ash/wm/workspace_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698