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_controller.h" | 5 #include "ash/wm/workspace_controller.h" |
6 | 6 |
7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
8 #include "ash/shelf/shelf_layout_manager.h" | 8 #include "ash/shelf/shelf_layout_manager.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
11 #include "ash/wm/window_animations.h" | 11 #include "ash/wm/window_animations.h" |
12 #include "ash/wm/window_state.h" | 12 #include "ash/wm/window_state.h" |
13 #include "ash/wm/window_util.h" | 13 #include "ash/wm/window_util.h" |
14 #include "ash/wm/workspace/workspace_event_handler.h" | 14 #include "ash/wm/workspace/workspace_event_handler.h" |
15 #include "ash/wm/workspace/workspace_layout_manager.h" | 15 #include "ash/wm/workspace/workspace_layout_manager.h" |
16 #include "ash/wm/workspace/workspace_layout_manager_delegate.h" | 16 #include "ash/wm/workspace/workspace_layout_manager_delegate.h" |
17 #include "ui/aura/client/aura_constants.h" | 17 #include "ui/aura/client/aura_constants.h" |
18 #include "ui/aura/window.h" | 18 #include "ui/aura/window.h" |
19 #include "ui/aura/window_event_dispatcher.h" | 19 #include "ui/aura/window_event_dispatcher.h" |
20 #include "ui/compositor/layer.h" | 20 #include "ui/compositor/layer.h" |
21 #include "ui/compositor/scoped_layer_animation_settings.h" | 21 #include "ui/compositor/scoped_layer_animation_settings.h" |
22 #include "ui/wm/core/visibility_controller.h" | 22 #include "ui/wm/core/visibility_controller.h" |
23 #include "ui/wm/core/window_animations.h" | 23 #include "ui/wm/core/window_animations.h" |
24 #include "ui/wm/public/activation_client.h" | 24 #include "ui/wm/public/activation_client.h" |
25 | 25 |
26 namespace ash { | 26 namespace ash { |
27 namespace internal { | |
28 namespace { | 27 namespace { |
29 | 28 |
30 // Amount of time to pause before animating anything. Only used during initial | 29 // Amount of time to pause before animating anything. Only used during initial |
31 // animation (when logging in). | 30 // animation (when logging in). |
32 const int kInitialPauseTimeMS = 750; | 31 const int kInitialPauseTimeMS = 750; |
33 | 32 |
34 // Returns true if there are visible docked windows in the same screen as the | 33 // Returns true if there are visible docked windows in the same screen as the |
35 // |shelf|. | 34 // |shelf|. |
36 bool IsDockedAreaVisible(const ShelfLayoutManager* shelf) { | 35 bool IsDockedAreaVisible(const ShelfLayoutManager* shelf) { |
37 return shelf->dock_bounds().width() > 0; | 36 return shelf->dock_bounds().width() > 0; |
(...skipping 25 matching lines...) Expand all Loading... |
63 return WORKSPACE_WINDOW_STATE_DEFAULT; | 62 return WORKSPACE_WINDOW_STATE_DEFAULT; |
64 const aura::Window* topmost_fullscreen_window = GetRootWindowController( | 63 const aura::Window* topmost_fullscreen_window = GetRootWindowController( |
65 viewport_->GetRootWindow())->GetWindowForFullscreenMode(); | 64 viewport_->GetRootWindow())->GetWindowForFullscreenMode(); |
66 if (topmost_fullscreen_window && | 65 if (topmost_fullscreen_window && |
67 !wm::GetWindowState(topmost_fullscreen_window)->ignored_by_shelf()) { | 66 !wm::GetWindowState(topmost_fullscreen_window)->ignored_by_shelf()) { |
68 return WORKSPACE_WINDOW_STATE_FULL_SCREEN; | 67 return WORKSPACE_WINDOW_STATE_FULL_SCREEN; |
69 } | 68 } |
70 | 69 |
71 // These are the container ids of containers which may contain windows that | 70 // These are the container ids of containers which may contain windows that |
72 // may overlap the launcher shelf and affect its transparency. | 71 // may overlap the launcher shelf and affect its transparency. |
73 const int kWindowContainerIds[] = { | 72 const int kWindowContainerIds[] = {kShellWindowId_DefaultContainer, |
74 internal::kShellWindowId_DefaultContainer, | 73 kShellWindowId_DockedContainer, }; |
75 internal::kShellWindowId_DockedContainer, | |
76 }; | |
77 const gfx::Rect shelf_bounds(shelf_->GetIdealBounds()); | 74 const gfx::Rect shelf_bounds(shelf_->GetIdealBounds()); |
78 bool window_overlaps_launcher = false; | 75 bool window_overlaps_launcher = false; |
79 for (size_t idx = 0; idx < arraysize(kWindowContainerIds); idx++) { | 76 for (size_t idx = 0; idx < arraysize(kWindowContainerIds); idx++) { |
80 const aura::Window* container = Shell::GetContainer( | 77 const aura::Window* container = Shell::GetContainer( |
81 viewport_->GetRootWindow(), kWindowContainerIds[idx]); | 78 viewport_->GetRootWindow(), kWindowContainerIds[idx]); |
82 const aura::Window::Windows& windows(container->children()); | 79 const aura::Window::Windows& windows(container->children()); |
83 for (aura::Window::Windows::const_iterator i = windows.begin(); | 80 for (aura::Window::Windows::const_iterator i = windows.begin(); |
84 i != windows.end(); ++i) { | 81 i != windows.end(); ++i) { |
85 wm::WindowState* window_state = wm::GetWindowState(*i); | 82 wm::WindowState* window_state = wm::GetWindowState(*i); |
86 if (window_state->ignored_by_shelf()) | 83 if (window_state->ignored_by_shelf()) |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 viewport_->layer()->SetTransform(gfx::Transform()); | 131 viewport_->layer()->SetTransform(gfx::Transform()); |
135 viewport_->layer()->SetOpacity(1.0f); | 132 viewport_->layer()->SetOpacity(1.0f); |
136 } | 133 } |
137 } | 134 } |
138 | 135 |
139 void WorkspaceController::SetMaximizeBackdropDelegate( | 136 void WorkspaceController::SetMaximizeBackdropDelegate( |
140 scoped_ptr<WorkspaceLayoutManagerDelegate> delegate) { | 137 scoped_ptr<WorkspaceLayoutManagerDelegate> delegate) { |
141 layout_manager_->SetMaximizeBackdropDelegate(delegate.Pass()); | 138 layout_manager_->SetMaximizeBackdropDelegate(delegate.Pass()); |
142 } | 139 } |
143 | 140 |
144 } // namespace internal | |
145 } // namespace ash | 141 } // namespace ash |
OLD | NEW |