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_layout_manager.h" | 5 #include "ash/wm/workspace/workspace_layout_manager.h" |
6 | 6 |
7 #include "ash/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/screen_util.h" | 9 #include "ash/screen_util.h" |
10 #include "ash/session_state_delegate.h" | 10 #include "ash/session_state_delegate.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
115 ////////////////////////////////////////////////////////////////////////////// | 115 ////////////////////////////////////////////////////////////////////////////// |
116 // WorkspaceLayoutManager, aura::LayoutManager implementation: | 116 // WorkspaceLayoutManager, aura::LayoutManager implementation: |
117 | 117 |
118 void WorkspaceLayoutManager::OnWindowAddedToLayout(Window* child) { | 118 void WorkspaceLayoutManager::OnWindowAddedToLayout(Window* child) { |
119 wm::WindowState* window_state = wm::GetWindowState(child); | 119 wm::WindowState* window_state = wm::GetWindowState(child); |
120 AdjustWindowBoundsWhenAdded(window_state); | 120 AdjustWindowBoundsWhenAdded(window_state); |
121 | 121 |
122 windows_.insert(child); | 122 windows_.insert(child); |
123 child->AddObserver(this); | 123 child->AddObserver(this); |
124 window_state->AddObserver(this); | 124 window_state->AddObserver(this); |
125 // TODO(oshima): This is necessary as the call in | |
126 // AdjustWindowBoundsWhenAdded is skipped when the bounds is | |
127 // empty. Investigate if we can eliminate this dup. | |
128 if (!window_state->is_dragged()) | |
129 SetMaximizedOrFullscreenBounds(window_state); | |
pkotwicz
2014/02/14 00:22:26
Optional Nit: You could modify the implementation
oshima
2014/02/14 00:42:49
Thanks, I'll clean up in separate CL with tests co
| |
125 UpdateShelfVisibility(); | 130 UpdateShelfVisibility(); |
126 UpdateFullscreenState(); | 131 UpdateFullscreenState(); |
127 WindowPositioner::RearrangeVisibleWindowOnShow(child); | 132 WindowPositioner::RearrangeVisibleWindowOnShow(child); |
128 } | 133 } |
129 | 134 |
130 void WorkspaceLayoutManager::OnWillRemoveWindowFromLayout(Window* child) { | 135 void WorkspaceLayoutManager::OnWillRemoveWindowFromLayout(Window* child) { |
131 windows_.erase(child); | 136 windows_.erase(child); |
132 child->RemoveObserver(this); | 137 child->RemoveObserver(this); |
133 wm::GetWindowState(child)->RemoveObserver(this); | 138 wm::GetWindowState(child)->RemoveObserver(this); |
134 | 139 |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
523 ui::ScopedLayerAnimationSettings slide_settings(layer->GetAnimator()); | 528 ui::ScopedLayerAnimationSettings slide_settings(layer->GetAnimator()); |
524 slide_settings.SetPreemptionStrategy( | 529 slide_settings.SetPreemptionStrategy( |
525 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); | 530 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); |
526 slide_settings.SetTransitionDuration( | 531 slide_settings.SetTransitionDuration( |
527 base::TimeDelta::FromMilliseconds(kBoundsChangeSlideDurationMs)); | 532 base::TimeDelta::FromMilliseconds(kBoundsChangeSlideDurationMs)); |
528 SetChildBoundsDirect(child, bounds); | 533 SetChildBoundsDirect(child, bounds); |
529 } | 534 } |
530 | 535 |
531 } // namespace internal | 536 } // namespace internal |
532 } // namespace ash | 537 } // namespace ash |
OLD | NEW |