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" |
(...skipping 11 matching lines...) Expand all Loading... |
22 // create and manage their windows on the screen. | 22 // create and manage their windows on the screen. |
23 class ATHENA_EXPORT ScreenManager { | 23 class ATHENA_EXPORT ScreenManager { |
24 public: | 24 public: |
25 struct ContainerParams { | 25 struct ContainerParams { |
26 ContainerParams(const std::string& name, int z_order_priority); | 26 ContainerParams(const std::string& name, int z_order_priority); |
27 std::string name; | 27 std::string name; |
28 | 28 |
29 // True if the container can activate its child window. | 29 // True if the container can activate its child window. |
30 bool can_activate_children; | 30 bool can_activate_children; |
31 | 31 |
32 // True if the container will block evnets from containers behind it. | 32 // True if the container will grab all of input events. |
33 bool block_events; | 33 bool grab_inputs; |
34 | 34 |
35 // Defines the z_order priority of the container. | 35 // Defines the z_order priority of the container. |
36 int z_order_priority; | 36 int z_order_priority; |
37 | |
38 // True if this container should be used as a default parent. | |
39 bool default_parent; | |
40 | |
41 // The container priority used to open modal dialog window | |
42 // created with this container as a transient parent (Note: A modal window | |
43 // should | |
44 // use a trnasient parent, not a direct parent, or no transient parent.) | |
45 // | |
46 // Default is -1, and it will fallback to the container behind this | |
47 // container, | |
48 // that has the modal container proiroty. | |
49 // | |
50 // The modal container for modal window is selected as follows. | |
51 // 1) a window must be created with |aura::client::kModalKey| property | |
52 // without explicit parent set. | |
53 // 2.a) If aura::client::kAlwaysOnTopKey is NOT set, it uses the stand flow | |
54 // described above. (fallback to containers behind this). | |
55 // 2.b) If aura::client::kAlwaysOnTopKey is set, it searches the top most | |
56 // container which has |modal_container_priority| != -1. | |
57 // 3) Look for the container with |modal_container_priority|, and create | |
58 // one if it doesn't exist. | |
59 // | |
60 // Created modal container will self destruct if last modal window | |
61 // is deleted. | |
62 int modal_container_priority; | |
63 }; | 37 }; |
64 | 38 |
65 // Creates, returns and deletes the singleton object of the ScreenManager | 39 // Creates, returns and deletes the singleton object of the ScreenManager |
66 // implementation. | 40 // implementation. |
67 static ScreenManager* Create(aura::Window* root); | 41 static ScreenManager* Create(aura::Window* root); |
68 static ScreenManager* Get(); | 42 static ScreenManager* Get(); |
69 static void Shutdown(); | 43 static void Shutdown(); |
70 | 44 |
71 virtual ~ScreenManager() {} | 45 virtual ~ScreenManager() {} |
72 | 46 |
| 47 // Creates the container window that is used when creating a normal |
| 48 // widget without specific parent. |
| 49 virtual aura::Window* CreateDefaultContainer( |
| 50 const ContainerParams& params) = 0; |
| 51 |
73 // Creates the container window on the screen. | 52 // Creates the container window on the screen. |
74 virtual aura::Window* CreateContainer(const ContainerParams& params) = 0; | 53 virtual aura::Window* CreateContainer(const ContainerParams& params) = 0; |
75 | 54 |
76 // Return the context object to be used for widget creation. | 55 // Return the context object to be used for widget creation. |
77 virtual aura::Window* GetContext() = 0; | 56 virtual aura::Window* GetContext() = 0; |
78 | 57 |
79 // Set screen rotation. | 58 // Set screen rotation. |
80 // TODO(flackr): Extract and use ash DisplayManager to set rotation | 59 // TODO(flackr): Extract and use ash DisplayManager to set rotation |
81 // instead: http://crbug.com/401044. | 60 // instead: http://crbug.com/401044. |
82 virtual void SetRotation(gfx::Display::Rotation rotation) = 0; | 61 virtual void SetRotation(gfx::Display::Rotation rotation) = 0; |
83 virtual void SetRotationLocked(bool rotation_locked) = 0; | 62 virtual void SetRotationLocked(bool rotation_locked) = 0; |
84 }; | 63 }; |
85 | 64 |
86 } // namespace athena | 65 } // namespace athena |
87 | 66 |
88 #endif // ATHENA_SCREEN_PUBLIC_SCREEN_MANAGER_H_ | 67 #endif // ATHENA_SCREEN_PUBLIC_SCREEN_MANAGER_H_ |
OLD | NEW |