Chromium Code Reviews| 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..5d24ffbf122f8c90ee12b0ad7ded753601580d9d 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 && |
| @@ -247,6 +250,10 @@ uint32 WindowComponentToMagneticEdge(int window_component) { |
| } // namespace |
| +WorkspaceWindowResizer* WorkspaceWindowResizer::GetInstanceForTest() { |
| + return instance; |
| +} |
|
oshima
2014/09/04 09:31:11
nit: keep this after static member variables. (aft
Anand Ratn (left samsung)
2014/09/04 10:16:30
Done.
|
| + |
| // static |
| const int WorkspaceWindowResizer::kMinOnscreenSize = 20; |
| @@ -256,9 +263,6 @@ const int WorkspaceWindowResizer::kMinOnscreenHeight = 32; |
| // static |
| const int WorkspaceWindowResizer::kScreenEdgeInset = 8; |
| -// static |
| -WorkspaceWindowResizer* WorkspaceWindowResizer::instance_ = NULL; |
| - |
| // Represents the width or height of a window with constraints on its minimum |
| // and maximum size. 0 represents a lack of a constraint. |
| class WindowSize { |
| @@ -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( |