| 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_animations.h" |
| 9 #include "ash/wm/window_properties.h" | 10 #include "ash/wm/window_properties.h" |
| 10 #include "ash/wm/window_util.h" | 11 #include "ash/wm/window_util.h" |
| 11 #include "ash/wm/workspace/workspace_event_handler.h" | 12 #include "ash/wm/workspace/workspace_event_handler.h" |
| 12 #include "ash/wm/workspace/workspace_layout_manager2.h" | 13 #include "ash/wm/workspace/workspace_layout_manager2.h" |
| 13 #include "ash/wm/workspace/workspace_manager2.h" | 14 #include "ash/wm/workspace/workspace_manager2.h" |
| 14 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
| 15 | 16 |
| 16 namespace ash { | 17 namespace ash { |
| 17 namespace internal { | 18 namespace internal { |
| 18 | 19 |
| 19 Workspace2::Workspace2(WorkspaceManager2* manager, | 20 Workspace2::Workspace2(WorkspaceManager2* manager, |
| 20 aura::Window* parent, | 21 aura::Window* parent, |
| 21 bool is_maximized) | 22 bool is_maximized) |
| 22 : is_maximized_(is_maximized), | 23 : is_maximized_(is_maximized), |
| 23 workspace_manager_(manager), | 24 workspace_manager_(manager), |
| 24 window_(new aura::Window(NULL)), | 25 window_(new aura::Window(NULL)), |
| 25 event_handler_(new WorkspaceEventHandler(window_)), | 26 event_handler_(new WorkspaceEventHandler(window_)), |
| 26 workspace_layout_manager_(NULL) { | 27 workspace_layout_manager_(NULL) { |
| 27 window_->SetProperty(internal::kChildWindowVisibilityChangesAnimatedKey, | 28 window_->SetProperty(internal::kChildWindowVisibilityChangesAnimatedKey, |
| 28 true); | 29 true); |
| 30 SetWindowVisibilityAnimationTransition(window_, ANIMATE_NONE); |
| 29 window_->set_id(kShellWindowId_WorkspaceContainer); | 31 window_->set_id(kShellWindowId_WorkspaceContainer); |
| 30 window_->SetName("WorkspaceContainer"); | 32 window_->SetName("WorkspaceContainer"); |
| 31 window_->Init(ui::LAYER_NOT_DRAWN); | 33 window_->Init(ui::LAYER_NOT_DRAWN); |
| 32 // Do this so when animating out windows don't extend beyond the bounds. | 34 // Do this so when animating out windows don't extend beyond the bounds. |
| 33 window_->layer()->SetMasksToBounds(true); | 35 window_->layer()->SetMasksToBounds(true); |
| 34 window_->Hide(); | 36 window_->Hide(); |
| 35 window_->SetParent(parent); | 37 window_->SetParent(parent); |
| 36 window_->SetProperty(internal::kUsesScreenCoordinatesKey, true); | 38 window_->SetProperty(internal::kUsesScreenCoordinatesKey, true); |
| 37 | 39 |
| 38 // The layout-manager cannot be created in the initializer list since it | 40 // The layout-manager cannot be created in the initializer list since it |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 WorkspaceManager2::WillRestoreMaximized(child))) { | 86 WorkspaceManager2::WillRestoreMaximized(child))) { |
| 85 if (++count == 2) | 87 if (++count == 2) |
| 86 return count; | 88 return count; |
| 87 } | 89 } |
| 88 } | 90 } |
| 89 return count; | 91 return count; |
| 90 } | 92 } |
| 91 | 93 |
| 92 } // namespace internal | 94 } // namespace internal |
| 93 } // namespace ash | 95 } // namespace ash |
| OLD | NEW |