| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 //////////////////////////////////////////////////////////////////////////////// | 118 //////////////////////////////////////////////////////////////////////////////// |
| 119 // Shell, public: | 119 // Shell, public: |
| 120 | 120 |
| 121 Shell::Shell(ShellDelegate* delegate) | 121 Shell::Shell(ShellDelegate* delegate) |
| 122 : ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)), | 122 : ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)), |
| 123 accelerator_controller_(new ShellAcceleratorController), | 123 accelerator_controller_(new ShellAcceleratorController), |
| 124 delegate_(delegate) { | 124 delegate_(delegate) { |
| 125 aura::RootWindow::GetInstance()->SetEventFilter( | 125 aura::RootWindow::GetInstance()->SetEventFilter( |
| 126 new internal::RootWindowEventFilter); | 126 new internal::RootWindowEventFilter); |
| 127 aura::RootWindow::GetInstance()->SetStackingClient( | |
| 128 new internal::StackingController); | |
| 129 } | 127 } |
| 130 | 128 |
| 131 Shell::~Shell() { | 129 Shell::~Shell() { |
| 132 RemoveRootWindowEventFilter(accelerator_filter_.get()); | 130 RemoveRootWindowEventFilter(accelerator_filter_.get()); |
| 133 | 131 |
| 134 // ShellTooltipManager needs a valid shell instance. We delete it before | 132 // ShellTooltipManager needs a valid shell instance. We delete it before |
| 135 // deleting the shell |instance_|. | 133 // deleting the shell |instance_|. |
| 136 RemoveRootWindowEventFilter(tooltip_manager_.get()); | 134 RemoveRootWindowEventFilter(tooltip_manager_.get()); |
| 137 aura::RootWindow::GetInstance()->SetProperty( | 135 aura::RootWindow::GetInstance()->SetProperty( |
| 138 aura::kRootWindowTooltipClientKey, | 136 aura::kRootWindowTooltipClientKey, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 187 |
| 190 aura::Window::Windows containers; | 188 aura::Window::Windows containers; |
| 191 CreateSpecialContainers(&containers); | 189 CreateSpecialContainers(&containers); |
| 192 aura::Window::Windows::const_iterator i; | 190 aura::Window::Windows::const_iterator i; |
| 193 for (i = containers.begin(); i != containers.end(); ++i) { | 191 for (i = containers.begin(); i != containers.end(); ++i) { |
| 194 (*i)->Init(ui::Layer::LAYER_HAS_NO_TEXTURE); | 192 (*i)->Init(ui::Layer::LAYER_HAS_NO_TEXTURE); |
| 195 root_window->AddChild(*i); | 193 root_window->AddChild(*i); |
| 196 (*i)->Show(); | 194 (*i)->Show(); |
| 197 } | 195 } |
| 198 | 196 |
| 199 internal::StackingController* stacking_controller = | 197 stacking_controller_.reset(new internal::StackingController); |
| 200 static_cast<internal::StackingController*>( | |
| 201 root_window->stacking_client()); | |
| 202 stacking_controller->Init(); | |
| 203 | 198 |
| 204 InitLayoutManagers(root_window); | 199 InitLayoutManagers(root_window); |
| 205 | 200 |
| 206 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 201 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 207 if (!command_line->HasSwitch(switches::kAuraNoShadows)) | 202 if (!command_line->HasSwitch(switches::kAuraNoShadows)) |
| 208 shadow_controller_.reset(new internal::ShadowController()); | 203 shadow_controller_.reset(new internal::ShadowController()); |
| 209 | 204 |
| 210 // Force a layout. | 205 // Force a layout. |
| 211 root_window->layout_manager()->OnWindowResized(); | 206 root_window->layout_manager()->OnWindowResized(); |
| 212 | 207 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 new internal::WorkspaceController(default_container)); | 330 new internal::WorkspaceController(default_container)); |
| 336 workspace_controller_->SetLauncherModel(launcher_->model()); | 331 workspace_controller_->SetLauncherModel(launcher_->model()); |
| 337 default_container->SetEventFilter( | 332 default_container->SetEventFilter( |
| 338 new internal::DefaultContainerEventFilter(default_container)); | 333 new internal::DefaultContainerEventFilter(default_container)); |
| 339 default_container->SetLayoutManager( | 334 default_container->SetLayoutManager( |
| 340 new internal::DefaultContainerLayoutManager( | 335 new internal::DefaultContainerLayoutManager( |
| 341 workspace_controller_->workspace_manager())); | 336 workspace_controller_->workspace_manager())); |
| 342 } | 337 } |
| 343 | 338 |
| 344 } // namespace aura_shell | 339 } // namespace aura_shell |
| OLD | NEW |