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

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

Issue 497733002: Declaring the weak_ptr_factory in proper order. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Maintaining function in proper order Created 6 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') | ash/wm/workspace/workspace_window_resizer_unittest.cc » ('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 395c2adbdc80f2f0e4ecd5dfad0bdf0f66077044..95813a27289a7bd991f7aa9b0d9e61e6a02f6d50 100644
--- a/ash/wm/workspace/workspace_window_resizer.cc
+++ b/ash/wm/workspace/workspace_window_resizer.cc
@@ -110,6 +110,9 @@ namespace {
// when resizing a window using touchscreen.
const int kScreenEdgeInsetForTouchDrag = 32;
+// Current instance for use by the WorkspaceWindowResizerTest.
+WorkspaceWindowResizer* instance = NULL;
+
// Returns true if the window should stick to the edge.
bool ShouldStickToEdge(int distance_from_edge, int sticky_size) {
return distance_from_edge < sticky_size &&
@@ -256,8 +259,9 @@ const int WorkspaceWindowResizer::kMinOnscreenHeight = 32;
// static
const int WorkspaceWindowResizer::kScreenEdgeInset = 8;
-// static
-WorkspaceWindowResizer* WorkspaceWindowResizer::instance_ = NULL;
+WorkspaceWindowResizer* WorkspaceWindowResizer::GetInstanceForTest() {
+ return instance;
+}
// Represents the width or height of a window with constraints on its minimum
// and maximum size. 0 represents a lack of a constraint.
@@ -333,8 +337,8 @@ WorkspaceWindowResizer::~WorkspaceWindowResizer() {
Shell* shell = Shell::GetInstance();
shell->cursor_manager()->UnlockCursor();
}
- if (instance_ == this)
- instance_ = NULL;
+ if (instance == this)
+ instance = NULL;
}
// static
@@ -547,7 +551,7 @@ WorkspaceWindowResizer::WorkspaceWindowResizer(
total_initial_size_ += initial_size;
total_available += std::max(min_size, initial_size) - min_size;
}
- instance_ = this;
+ instance = this;
}
void WorkspaceWindowResizer::LayoutAttachedWindows(
« 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