| 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 #include "ash/wm/workspace/workspace.h" | 5 #include "ash/wm/workspace/workspace.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/wm/property_util.h" | 9 #include "ash/wm/property_util.h" |
| 10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 } | 56 } |
| 57 | 57 |
| 58 bool Workspace::Contains(aura::Window* window) const { | 58 bool Workspace::Contains(aura::Window* window) const { |
| 59 return std::find(windows_.begin(), windows_.end(), window) != windows_.end(); | 59 return std::find(windows_.begin(), windows_.end(), window) != windows_.end(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void Workspace::Activate() { | 62 void Workspace::Activate() { |
| 63 workspace_manager_->SetActiveWorkspace(this); | 63 workspace_manager_->SetActiveWorkspace(this); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void Workspace::SetBounds(const gfx::Rect& bounds) { | |
| 67 if (bounds_ == bounds) | |
| 68 return; | |
| 69 | |
| 70 gfx::Rect old_bounds = bounds_; | |
| 71 bounds_ = bounds; | |
| 72 // Don't send size change for transition from empty -> not empty. That only | |
| 73 // happens when we're first created. | |
| 74 if (!old_bounds.IsEmpty()) | |
| 75 OnWorkspaceSizeChanged(old_bounds); | |
| 76 } | |
| 77 | |
| 78 void Workspace::SetWindowBounds(aura::Window* window, const gfx::Rect& bounds) { | 66 void Workspace::SetWindowBounds(aura::Window* window, const gfx::Rect& bounds) { |
| 79 workspace_manager_->SetWindowBounds(window, bounds); | 67 workspace_manager_->SetWindowBounds(window, bounds); |
| 80 } | 68 } |
| 81 | 69 |
| 82 void Workspace::SetIgnoredWindow(aura::Window* window) { | 70 void Workspace::SetIgnoredWindow(aura::Window* window) { |
| 83 workspace_manager_->set_ignored_window(window); | 71 workspace_manager_->set_ignored_window(window); |
| 84 } | 72 } |
| 85 | 73 |
| 86 } // namespace internal | 74 } // namespace internal |
| 87 } // namespace ash | 75 } // namespace ash |
| OLD | NEW |