| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/screen/public/screen_manager.h" | 5 #include "athena/screen/public/screen_manager.h" |
| 6 | 6 |
| 7 #include "athena/common/container_priorities.h" | 7 #include "athena/common/container_priorities.h" |
| 8 #include "athena/common/fill_layout_manager.h" | 8 #include "athena/common/fill_layout_manager.h" |
| 9 #include "athena/input/public/accelerator_manager.h" | 9 #include "athena/input/public/accelerator_manager.h" |
| 10 #include "athena/screen/background_controller.h" | 10 #include "athena/screen/background_controller.h" |
| 11 #include "athena/screen/screen_accelerator_handler.h" | 11 #include "athena/screen/screen_accelerator_handler.h" |
| 12 #include "athena/screen/screen_animator_impl.h" |
| 12 #include "base/logging.h" | 13 #include "base/logging.h" |
| 13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 14 #include "ui/aura/client/screen_position_client.h" | 15 #include "ui/aura/client/screen_position_client.h" |
| 15 #include "ui/aura/client/window_tree_client.h" | 16 #include "ui/aura/client/window_tree_client.h" |
| 16 #include "ui/aura/layout_manager.h" | 17 #include "ui/aura/layout_manager.h" |
| 17 #include "ui/aura/window.h" | 18 #include "ui/aura/window.h" |
| 18 #include "ui/aura/window_property.h" | 19 #include "ui/aura/window_property.h" |
| 19 #include "ui/aura/window_targeter.h" | 20 #include "ui/aura/window_targeter.h" |
| 20 #include "ui/aura/window_tree_host.h" | 21 #include "ui/aura/window_tree_host.h" |
| 21 #include "ui/wm/core/base_focus_rules.h" | 22 #include "ui/wm/core/base_focus_rules.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 193 |
| 193 void Init(); | 194 void Init(); |
| 194 | 195 |
| 195 private: | 196 private: |
| 196 // ScreenManager: | 197 // ScreenManager: |
| 197 virtual aura::Window* CreateDefaultContainer( | 198 virtual aura::Window* CreateDefaultContainer( |
| 198 const ContainerParams& params) OVERRIDE; | 199 const ContainerParams& params) OVERRIDE; |
| 199 virtual aura::Window* CreateContainer(const ContainerParams& params) OVERRIDE; | 200 virtual aura::Window* CreateContainer(const ContainerParams& params) OVERRIDE; |
| 200 virtual aura::Window* GetContext() OVERRIDE { return root_window_; } | 201 virtual aura::Window* GetContext() OVERRIDE { return root_window_; } |
| 201 virtual void SetBackgroundImage(const gfx::ImageSkia& image) OVERRIDE; | 202 virtual void SetBackgroundImage(const gfx::ImageSkia& image) OVERRIDE; |
| 203 virtual scoped_ptr<ScreenAnimator> CreateScreenAnimator() OVERRIDE; |
| 202 | 204 |
| 203 aura::Window* root_window_; | 205 aura::Window* root_window_; |
| 204 aura::Window* background_window_; | 206 aura::Window* background_window_; |
| 205 | 207 |
| 206 scoped_ptr<BackgroundController> background_controller_; | 208 scoped_ptr<BackgroundController> background_controller_; |
| 207 scoped_ptr<aura::client::WindowTreeClient> window_tree_client_; | 209 scoped_ptr<aura::client::WindowTreeClient> window_tree_client_; |
| 208 scoped_ptr<AcceleratorHandler> accelerator_handler_; | 210 scoped_ptr<AcceleratorHandler> accelerator_handler_; |
| 209 scoped_ptr< ::wm::ScopedCaptureClient> capture_client_; | 211 scoped_ptr< ::wm::ScopedCaptureClient> capture_client_; |
| 210 scoped_ptr<aura::client::ScreenPositionClient> screen_position_client_; | 212 scoped_ptr<aura::client::ScreenPositionClient> screen_position_client_; |
| 211 | 213 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 root_window_->StackChildBelow(container, *iter); | 317 root_window_->StackChildBelow(container, *iter); |
| 316 | 318 |
| 317 container->Show(); | 319 container->Show(); |
| 318 return container; | 320 return container; |
| 319 } | 321 } |
| 320 | 322 |
| 321 void ScreenManagerImpl::SetBackgroundImage(const gfx::ImageSkia& image) { | 323 void ScreenManagerImpl::SetBackgroundImage(const gfx::ImageSkia& image) { |
| 322 background_controller_->SetImage(image); | 324 background_controller_->SetImage(image); |
| 323 } | 325 } |
| 324 | 326 |
| 327 scoped_ptr<ScreenAnimator> ScreenManagerImpl::CreateScreenAnimator() { |
| 328 return scoped_ptr<ScreenAnimator>(new ScreenAnimatorImpl(root_window_)); |
| 329 } |
| 330 |
| 325 } // namespace | 331 } // namespace |
| 326 | 332 |
| 327 ScreenManager::ContainerParams::ContainerParams(const std::string& n, | 333 ScreenManager::ContainerParams::ContainerParams(const std::string& n, |
| 328 int priority) | 334 int priority) |
| 329 : name(n), | 335 : name(n), |
| 330 can_activate_children(false), | 336 can_activate_children(false), |
| 331 grab_inputs(false), | 337 grab_inputs(false), |
| 332 z_order_priority(priority) { | 338 z_order_priority(priority) { |
| 333 } | 339 } |
| 334 | 340 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 351 delete instance; | 357 delete instance; |
| 352 DCHECK(!instance); | 358 DCHECK(!instance); |
| 353 } | 359 } |
| 354 | 360 |
| 355 // static | 361 // static |
| 356 wm::FocusRules* ScreenManager::CreateFocusRules() { | 362 wm::FocusRules* ScreenManager::CreateFocusRules() { |
| 357 return new AthenaFocusRules(); | 363 return new AthenaFocusRules(); |
| 358 } | 364 } |
| 359 | 365 |
| 360 } // namespace athena | 366 } // namespace athena |
| OLD | NEW |