| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "ui/aura_shell/shell.h" | 5 #include "ui/aura_shell/shell.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "ui/aura/desktop.h" | 8 #include "ui/aura/desktop.h" |
| 9 #include "ui/aura/screen_aura.h" | 9 #include "ui/aura/screen_aura.h" |
| 10 #include "ui/aura/toplevel_window_container.h" | 10 #include "ui/aura/toplevel_window_container.h" |
| 11 #include "ui/aura/window.h" | 11 #include "ui/aura/window.h" |
| 12 #include "ui/aura/window_types.h" | 12 #include "ui/aura/window_types.h" |
| 13 #include "ui/aura_shell/default_container_event_filter.h" | 13 #include "ui/aura_shell/default_container_event_filter.h" |
| 14 #include "ui/aura_shell/default_container_layout_manager.h" |
| 14 #include "ui/aura_shell/desktop_layout_manager.h" | 15 #include "ui/aura_shell/desktop_layout_manager.h" |
| 15 #include "ui/aura_shell/launcher/launcher.h" | 16 #include "ui/aura_shell/launcher/launcher.h" |
| 16 #include "ui/aura_shell/shell_delegate.h" | 17 #include "ui/aura_shell/shell_delegate.h" |
| 17 #include "ui/aura_shell/shell_factory.h" | 18 #include "ui/aura_shell/shell_factory.h" |
| 18 #include "ui/aura_shell/shell_window_ids.h" | 19 #include "ui/aura_shell/shell_window_ids.h" |
| 19 #include "ui/aura_shell/workspace/workspace_controller.h" | 20 #include "ui/aura_shell/workspace/workspace_controller.h" |
| 20 #include "ui/gfx/compositor/layer.h" | 21 #include "ui/gfx/compositor/layer.h" |
| 21 #include "ui/gfx/compositor/layer_animator.h" | 22 #include "ui/gfx/compositor/layer_animator.h" |
| 22 #include "views/widget/native_widget_aura.h" | 23 #include "views/widget/native_widget_aura.h" |
| 23 #include "views/widget/widget.h" | 24 #include "views/widget/widget.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 desktop_layout->set_status_area_widget(internal::CreateStatusArea()); | 121 desktop_layout->set_status_area_widget(internal::CreateStatusArea()); |
| 121 | 122 |
| 122 desktop_window->screen()->set_work_area_insets( | 123 desktop_window->screen()->set_work_area_insets( |
| 123 gfx::Insets( | 124 gfx::Insets( |
| 124 0, kWorkAreaHorizontalMargin, | 125 0, kWorkAreaHorizontalMargin, |
| 125 launcher_->widget()->GetWindowScreenBounds().height(), | 126 launcher_->widget()->GetWindowScreenBounds().height(), |
| 126 kWorkAreaHorizontalMargin)); | 127 kWorkAreaHorizontalMargin)); |
| 127 | 128 |
| 128 workspace_controller_.reset( | 129 workspace_controller_.reset( |
| 129 new internal::WorkspaceController(toplevel_container)); | 130 new internal::WorkspaceController(toplevel_container)); |
| 131 toplevel_container->SetLayoutManager( |
| 132 new internal::DefaultContainerLayoutManager( |
| 133 workspace_controller_->workspace_manager())); |
| 130 | 134 |
| 131 // Force a layout. | 135 // Force a layout. |
| 132 desktop_layout->OnWindowResized(); | 136 desktop_layout->OnWindowResized(); |
| 133 } | 137 } |
| 134 | 138 |
| 135 void Shell::SetDelegate(ShellDelegate* delegate) { | 139 void Shell::SetDelegate(ShellDelegate* delegate) { |
| 136 delegate_.reset(delegate); | 140 delegate_.reset(delegate); |
| 137 } | 141 } |
| 138 | 142 |
| 139 aura::Window* Shell::GetContainer(int container_id) { | 143 aura::Window* Shell::GetContainer(int container_id) { |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } | 176 } |
| 173 | 177 |
| 174 aura::Window* Shell::GetTopmostWindowToActivate(aura::Window* ignore) const { | 178 aura::Window* Shell::GetTopmostWindowToActivate(aura::Window* ignore) const { |
| 175 const aura::ToplevelWindowContainer* container = | 179 const aura::ToplevelWindowContainer* container = |
| 176 GetContainer(internal::kShellWindowId_DefaultContainer)-> | 180 GetContainer(internal::kShellWindowId_DefaultContainer)-> |
| 177 AsToplevelWindowContainer(); | 181 AsToplevelWindowContainer(); |
| 178 return container->GetTopmostWindowToActivate(ignore); | 182 return container->GetTopmostWindowToActivate(ignore); |
| 179 } | 183 } |
| 180 | 184 |
| 181 } // namespace aura_shell | 185 } // namespace aura_shell |
| OLD | NEW |