| OLD | NEW |
| 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 #ifndef ASH_WM_WORKSPACE_WORKSPACE_WINDOW_RESIZER_H_ | 5 #ifndef ASH_WM_COMMON_WORKSPACE_WORKSPACE_WINDOW_RESIZER_H_ |
| 6 #define ASH_WM_WORKSPACE_WORKSPACE_WINDOW_RESIZER_H_ | 6 #define ASH_WM_COMMON_WORKSPACE_WORKSPACE_WINDOW_RESIZER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "ash/wm/common/window_resizer.h" | 13 #include "ash/wm/common/window_resizer.h" |
| 14 #include "ash/wm/common/wm_window_tracker.h" | 14 #include "ash/wm/common/wm_window_tracker.h" |
| 15 #include "ash/wm/workspace/magnetism_matcher.h" | 15 #include "ash/wm/common/workspace/magnetism_matcher.h" |
| 16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 19 | 19 |
| 20 namespace ash { | 20 namespace ash { |
| 21 class DockedWindowLayoutManager; | 21 class DockedWindowLayoutManager; |
| 22 class PhantomWindowController; | 22 class PhantomWindowController; |
| 23 class TwoStepEdgeCycler; | 23 class TwoStepEdgeCycler; |
| 24 class WindowSize; | 24 class WindowSize; |
| 25 | 25 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 // window has been resized (along the primary axis) by |delta|. | 79 // window has been resized (along the primary axis) by |delta|. |
| 80 // |available_size| is the maximum length of the space that the attached | 80 // |available_size| is the maximum length of the space that the attached |
| 81 // windows are allowed to occupy (ie: the distance between the right/bottom | 81 // windows are allowed to occupy (ie: the distance between the right/bottom |
| 82 // edge of the primary window and the right/bottom of the desktop area). | 82 // edge of the primary window and the right/bottom of the desktop area). |
| 83 // Populates |sizes| with the desired sizes of the attached windows, and | 83 // Populates |sizes| with the desired sizes of the attached windows, and |
| 84 // returns the number of pixels that couldn't be allocated to the attached | 84 // returns the number of pixels that couldn't be allocated to the attached |
| 85 // windows (due to min/max size constraints). | 85 // windows (due to min/max size constraints). |
| 86 // Note the return value can be positive or negative, a negative value | 86 // Note the return value can be positive or negative, a negative value |
| 87 // indicating that that many pixels couldn't be removed from the attached | 87 // indicating that that many pixels couldn't be removed from the attached |
| 88 // windows. | 88 // windows. |
| 89 int CalculateAttachedSizes( | 89 int CalculateAttachedSizes(int delta, |
| 90 int delta, | 90 int available_size, |
| 91 int available_size, | 91 std::vector<int>* sizes) const; |
| 92 std::vector<int>* sizes) const; | |
| 93 | 92 |
| 94 // Divides |amount| evenly between |sizes|. If |amount| is negative it | 93 // Divides |amount| evenly between |sizes|. If |amount| is negative it |
| 95 // indicates how many pixels |sizes| should be shrunk by. | 94 // indicates how many pixels |sizes| should be shrunk by. |
| 96 // Returns how many pixels failed to be allocated/removed from |sizes|. | 95 // Returns how many pixels failed to be allocated/removed from |sizes|. |
| 97 int GrowFairly(int amount, std::vector<WindowSize>* sizes) const; | 96 int GrowFairly(int amount, std::vector<WindowSize>* sizes) const; |
| 98 | 97 |
| 99 // Calculate the ratio of pixels that each WindowSize in |sizes| should | 98 // Calculate the ratio of pixels that each WindowSize in |sizes| should |
| 100 // receive when growing or shrinking. | 99 // receive when growing or shrinking. |
| 101 void CalculateGrowthRatios(const std::vector<WindowSize*>& sizes, | 100 void CalculateGrowthRatios(const std::vector<WindowSize*>& sizes, |
| 102 std::vector<float>* out_ratios) const; | 101 std::vector<float>* out_ratios) const; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 | 220 |
| 222 // Used to determine if this has been deleted during a drag such as when a tab | 221 // Used to determine if this has been deleted during a drag such as when a tab |
| 223 // gets dragged into another browser window. | 222 // gets dragged into another browser window. |
| 224 base::WeakPtrFactory<WorkspaceWindowResizer> weak_ptr_factory_; | 223 base::WeakPtrFactory<WorkspaceWindowResizer> weak_ptr_factory_; |
| 225 | 224 |
| 226 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizer); | 225 DISALLOW_COPY_AND_ASSIGN(WorkspaceWindowResizer); |
| 227 }; | 226 }; |
| 228 | 227 |
| 229 } // namespace ash | 228 } // namespace ash |
| 230 | 229 |
| 231 #endif // ASH_WM_WORKSPACE_WORKSPACE_WINDOW_RESIZER_H_ | 230 #endif // ASH_WM_COMMON_WORKSPACE_WORKSPACE_WINDOW_RESIZER_H_ |
| OLD | NEW |