| 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/workspace2.h" | 5 #include "ash/wm/workspace/workspace2.h" |
| 6 | 6 |
| 7 #include "ash/shell_window_ids.h" | 7 #include "ash/shell_window_ids.h" |
| 8 #include "ash/wm/property_util.h" | 8 #include "ash/wm/property_util.h" |
| 9 #include "ash/wm/window_properties.h" | 9 #include "ash/wm/window_properties.h" |
| 10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 event_handler_(new WorkspaceEventHandler(window_)) { | 24 event_handler_(new WorkspaceEventHandler(window_)) { |
| 25 window_->SetProperty(internal::kChildWindowVisibilityChangesAnimatedKey, | 25 window_->SetProperty(internal::kChildWindowVisibilityChangesAnimatedKey, |
| 26 true); | 26 true); |
| 27 window_->set_id(kShellWindowId_WorkspaceContainer); | 27 window_->set_id(kShellWindowId_WorkspaceContainer); |
| 28 window_->SetName("WorkspaceContainer"); | 28 window_->SetName("WorkspaceContainer"); |
| 29 window_->Init(ui::LAYER_NOT_DRAWN); | 29 window_->Init(ui::LAYER_NOT_DRAWN); |
| 30 // Do this so when animating out windows don't extend beyond the bounds. | 30 // Do this so when animating out windows don't extend beyond the bounds. |
| 31 window_->layer()->SetMasksToBounds(true); | 31 window_->layer()->SetMasksToBounds(true); |
| 32 window_->Hide(); | 32 window_->Hide(); |
| 33 window_->SetParent(parent); | 33 window_->SetParent(parent); |
| 34 window_->AddPreTargetHandler(event_handler_.get()); | |
| 35 window_->SetProperty(internal::kUsesScreenCoordinatesKey, true); | 34 window_->SetProperty(internal::kUsesScreenCoordinatesKey, true); |
| 36 } | 35 } |
| 37 | 36 |
| 38 Workspace2::~Workspace2() { | 37 Workspace2::~Workspace2() { |
| 39 // ReleaseWindow() should have been invoked before we're deleted. | 38 // ReleaseWindow() should have been invoked before we're deleted. |
| 40 DCHECK(!window_); | 39 DCHECK(!window_); |
| 41 } | 40 } |
| 42 | 41 |
| 43 aura::Window* Workspace2::ReleaseWindow() { | 42 aura::Window* Workspace2::ReleaseWindow() { |
| 44 // Remove the LayoutManager and EventFilter as they refer back to us and/or | 43 // Remove the LayoutManager and EventFilter as they refer back to us and/or |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 WorkspaceManager2::WillRestoreMaximized(child)) { | 75 WorkspaceManager2::WillRestoreMaximized(child)) { |
| 77 if (++count == 2) | 76 if (++count == 2) |
| 78 return count; | 77 return count; |
| 79 } | 78 } |
| 80 } | 79 } |
| 81 return count; | 80 return count; |
| 82 } | 81 } |
| 83 | 82 |
| 84 } // namespace internal | 83 } // namespace internal |
| 85 } // namespace ash | 84 } // namespace ash |
| OLD | NEW |