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

Unified Diff: ash/wm/workspace/workspace_window_resizer.cc

Issue 1366123002: Cleanup: IWYU for base/gtest_prod_util.h. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gtest_iwyu
Patch Set: more lint Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer.h ('k') | base/memory/memory_pressure_monitor_chromeos.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/workspace/workspace_window_resizer.cc
diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc
index 2b30dd1701ce7744d3270c9f7cf42831c7f302fc..2c082076970e2d816f767dda8564361db6209636 100644
--- a/ash/wm/workspace/workspace_window_resizer.cc
+++ b/ash/wm/workspace/workspace_window_resizer.cc
@@ -278,7 +278,7 @@ class WindowSize {
max_ = size_;
}
- bool is_at_capacity(bool shrinking) {
+ bool is_at_capacity(bool shrinking) const {
return size_ == (shrinking ? min_ : max_);
}
@@ -630,7 +630,7 @@ int WorkspaceWindowResizer::CalculateAttachedSizes(
int leftover_pixels = 0;
while (grow_attached_by != 0) {
- int leftovers = GrowFairly(grow_attached_by, window_sizes);
+ int leftovers = GrowFairly(grow_attached_by, &window_sizes);
if (leftovers == grow_attached_by) {
leftover_pixels = leftovers;
break;
@@ -644,14 +644,14 @@ int WorkspaceWindowResizer::CalculateAttachedSizes(
return leftover_pixels;
}
-int WorkspaceWindowResizer::GrowFairly(
- int pixels,
- std::vector<WindowSize>& sizes) const {
+int WorkspaceWindowResizer::GrowFairly(int pixels,
+ std::vector<WindowSize>* sizes) const {
bool shrinking = pixels < 0;
std::vector<WindowSize*> nonfull_windows;
- for (size_t i = 0; i < sizes.size(); ++i) {
- if (!sizes[i].is_at_capacity(shrinking))
- nonfull_windows.push_back(&sizes[i]);
+ for (size_t i = 0; i < sizes->size(); ++i) {
+ WindowSize& current_window_size = (*sizes)[i];
+ if (!current_window_size.is_at_capacity(shrinking))
+ nonfull_windows.push_back(&current_window_size);
}
std::vector<float> ratios;
CalculateGrowthRatios(nonfull_windows, &ratios);
« no previous file with comments | « ash/wm/workspace/workspace_window_resizer.h ('k') | base/memory/memory_pressure_monitor_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698