Chromium Code Reviews| 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 #ifndef ATHENA_SCREEN_PUBLIC_SCREEN_MANAGER_H_ | 5 #ifndef ATHENA_SCREEN_PUBLIC_SCREEN_MANAGER_H_ |
| 6 #define ATHENA_SCREEN_PUBLIC_SCREEN_MANAGER_H_ | 6 #define ATHENA_SCREEN_PUBLIC_SCREEN_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "athena/athena_export.h" | 10 #include "athena/athena_export.h" |
| 11 | 11 |
| 12 namespace aura { | 12 namespace aura { |
| 13 class Window; | 13 class Window; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace gfx { | 16 namespace gfx { |
| 17 class ImageSkia; | 17 class ImageSkia; |
| 18 class Insets; | |
| 19 class Rect; | |
| 18 } | 20 } |
| 19 | 21 |
| 20 namespace ui { | 22 namespace ui { |
| 21 class LayerAnimator; | 23 class LayerAnimator; |
| 22 } | 24 } |
| 23 | 25 |
| 24 namespace wm { | 26 namespace wm { |
| 25 class FocusRules; | 27 class FocusRules; |
| 26 } | 28 } |
| 27 | 29 |
| 28 namespace athena { | 30 namespace athena { |
| 31 class ScreenManagerDelegate; | |
| 29 | 32 |
| 30 // Mananges basic UI components on the screen such as background, and provide | 33 // Mananges basic UI components on the screen such as background, and provide |
| 31 // API for other UI components, such as window manager, home card, to | 34 // API for other UI components, such as window manager, home card, to |
| 32 // create and manage their windows on the screen. | 35 // create and manage their windows on the screen. |
| 33 class ATHENA_EXPORT ScreenManager { | 36 class ATHENA_EXPORT ScreenManager { |
| 34 public: | 37 public: |
| 35 struct ContainerParams { | 38 struct ContainerParams { |
| 36 ContainerParams(const std::string& name, int z_order_priority); | 39 ContainerParams(const std::string& name, int z_order_priority); |
| 37 std::string name; | 40 std::string name; |
| 38 | 41 |
| 39 // True if the container can activate its child window. | 42 // True if the container can activate its child window. |
| 40 bool can_activate_children; | 43 bool can_activate_children; |
| 41 | 44 |
| 42 // True if the container will grab all of input events. | 45 // True if the container will grab all of input events. |
| 43 bool grab_inputs; | 46 bool grab_inputs; |
| 44 | 47 |
| 45 // Defines the z_order priority of the container. | 48 // Defines the z_order priority of the container. |
| 46 int z_order_priority; | 49 int z_order_priority; |
| 47 }; | 50 }; |
| 48 | 51 |
| 49 // Creates, returns and deletes the singleton object of the ScreenManager | 52 // Creates, returns and deletes the singleton object of the ScreenManager |
| 50 // implementation. | 53 // implementation. |
| 51 static ScreenManager* Create(aura::Window* root); | 54 static ScreenManager* Create(ScreenManagerDelegate* delegate, |
| 55 aura::Window* root); | |
| 52 static ScreenManager* Get(); | 56 static ScreenManager* Get(); |
| 53 static void Shutdown(); | 57 static void Shutdown(); |
| 54 | 58 |
| 55 virtual ~ScreenManager() {} | 59 virtual ~ScreenManager() {} |
| 56 | 60 |
| 61 // Returns the screen's work area. | |
| 62 virtual gfx::Rect GetWorkArea() = 0; | |
|
pkotwicz
2014/08/13 13:48:55
I think that having ScreenManager::GetWorkArea() i
| |
| 63 | |
| 64 // Sets the screen's work area insets. | |
| 65 virtual void SetWorkAreaInsets(const gfx::Insets& insets) = 0; | |
| 66 | |
| 57 // Creates the container window that is used when creating a normal | 67 // Creates the container window that is used when creating a normal |
| 58 // widget without specific parent. | 68 // widget without specific parent. |
| 59 virtual aura::Window* CreateDefaultContainer( | 69 virtual aura::Window* CreateDefaultContainer( |
| 60 const ContainerParams& params) = 0; | 70 const ContainerParams& params) = 0; |
| 61 | 71 |
| 62 // Creates the container window on the screen. | 72 // Creates the container window on the screen. |
| 63 virtual aura::Window* CreateContainer(const ContainerParams& params) = 0; | 73 virtual aura::Window* CreateContainer(const ContainerParams& params) = 0; |
| 64 | 74 |
| 65 // Return the context object to be used for widget creation. | 75 // Return the context object to be used for widget creation. |
| 66 virtual aura::Window* GetContext() = 0; | 76 virtual aura::Window* GetContext() = 0; |
| 67 | 77 |
| 68 // Sets the background image. | 78 // Sets the background image. |
| 69 virtual void SetBackgroundImage(const gfx::ImageSkia& image) = 0; | 79 virtual void SetBackgroundImage(const gfx::ImageSkia& image) = 0; |
| 70 | 80 |
| 71 // Returns the LayerAnimator to use to animate the entire screen (e.g. fade | 81 // Returns the LayerAnimator to use to animate the entire screen (e.g. fade |
| 72 // screen to white). | 82 // screen to white). |
| 73 virtual ui::LayerAnimator* GetScreenAnimator() = 0; | 83 virtual ui::LayerAnimator* GetScreenAnimator() = 0; |
| 74 | 84 |
| 75 // Create a focus rules. | 85 // Create a focus rules. |
| 76 // TODO(oshima): Make this virtual function. | 86 // TODO(oshima): Make this virtual function. |
| 77 static wm::FocusRules* CreateFocusRules(); | 87 static wm::FocusRules* CreateFocusRules(); |
| 78 }; | 88 }; |
| 79 | 89 |
| 80 } // namespace athena | 90 } // namespace athena |
| 81 | 91 |
| 82 #endif // ATHENA_SCREEN_PUBLIC_SCREEN_MANAGER_H_ | 92 #endif // ATHENA_SCREEN_PUBLIC_SCREEN_MANAGER_H_ |
| OLD | NEW |