OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "mash/wm/container_ids.h" |
| 6 |
| 7 #include "ash/wm/common/wm_shell_window_ids.h" |
| 8 #include "mash/wm/public/interfaces/container.mojom.h" |
| 9 |
| 10 namespace mash { |
| 11 namespace wm { |
| 12 |
| 13 const mojom::Container kActivationContainers[] = { |
| 14 // TODO(sky): figure out right set of containers. I suspect this should be |
| 15 // all non containers. |
| 16 mojom::Container::USER_PRIVATE, |
| 17 // Bubble windows must be allowed to activate because some of them rely on |
| 18 // deactivation to close. |
| 19 mojom::Container::BUBBLES, |
| 20 }; |
| 21 |
| 22 const size_t kNumActivationContainers = arraysize(kActivationContainers); |
| 23 |
| 24 mojom::Container AshContainerToMashContainer(int ash_id) { |
| 25 switch (ash_id) { |
| 26 case ash::kShellWindowId_UnparentedControlContainer: |
| 27 case ash::kShellWindowId_LockScreenContainer: |
| 28 case ash::kShellWindowId_LockSystemModalContainer: |
| 29 // We should never be asked to parent windows of these types. |
| 30 NOTREACHED(); |
| 31 return mojom::Container::USER_PRIVATE; |
| 32 |
| 33 case ash::kShellWindowId_DefaultContainer: |
| 34 return mojom::Container::USER_PRIVATE_WINDOWS; |
| 35 |
| 36 case ash::kShellWindowId_AlwaysOnTopContainer: |
| 37 return mojom::Container::USER_PRIVATE_ALWAYS_ON_TOP_WINDOWS; |
| 38 |
| 39 case ash::kShellWindowId_DockedContainer: |
| 40 return mojom::Container::USER_PRIVATE_DOCKED_WINDOWS; |
| 41 |
| 42 case ash::kShellWindowId_ShelfContainer: |
| 43 return mojom::Container::USER_PRIVATE_SHELF; |
| 44 |
| 45 case ash::kShellWindowId_PanelContainer: |
| 46 return mojom::Container::USER_PRIVATE_PANELS; |
| 47 |
| 48 case ash::kShellWindowId_AppListContainer: |
| 49 return mojom::Container::USER_PRIVATE_APP_LIST; |
| 50 |
| 51 case ash::kShellWindowId_SystemModalContainer: |
| 52 return mojom::Container::USER_PRIVATE_SYSTEM_MODAL; |
| 53 |
| 54 case ash::kShellWindowId_MenuContainer: |
| 55 return mojom::Container::MENUS; |
| 56 |
| 57 case ash::kShellWindowId_DragImageAndTooltipContainer: |
| 58 return mojom::Container::DRAG_AND_TOOLTIPS; |
| 59 |
| 60 default: |
| 61 NOTREACHED(); |
| 62 } |
| 63 return mojom::Container::USER_PRIVATE_WINDOWS; |
| 64 } |
| 65 |
| 66 int MashContainerToAshContainer(mojom::Container container) { |
| 67 switch (container) { |
| 68 case mojom::Container::ROOT: |
| 69 return kUnknownAshId; |
| 70 |
| 71 case mojom::Container::ALL_USER_BACKGROUND: |
| 72 return kUnknownAshId; |
| 73 |
| 74 case mojom::Container::USER: |
| 75 return kUnknownAshId; |
| 76 |
| 77 case mojom::Container::USER_BACKGROUND: |
| 78 return kUnknownAshId; |
| 79 |
| 80 case mojom::Container::USER_PRIVATE: |
| 81 return kUnknownAshId; |
| 82 |
| 83 case mojom::Container::USER_PRIVATE_WINDOWS: |
| 84 return ash::kShellWindowId_DefaultContainer; |
| 85 |
| 86 case mojom::Container::USER_PRIVATE_ALWAYS_ON_TOP_WINDOWS: |
| 87 return ash::kShellWindowId_AlwaysOnTopContainer; |
| 88 |
| 89 case mojom::Container::USER_PRIVATE_DOCKED_WINDOWS: |
| 90 return ash::kShellWindowId_DockedContainer; |
| 91 |
| 92 case mojom::Container::USER_PRIVATE_PRESENTATION_WINDOWS: |
| 93 return kUnknownAshId; |
| 94 |
| 95 case mojom::Container::USER_PRIVATE_SHELF: |
| 96 return ash::kShellWindowId_ShelfContainer; |
| 97 |
| 98 case mojom::Container::USER_PRIVATE_PANELS: |
| 99 return ash::kShellWindowId_PanelContainer; |
| 100 |
| 101 case mojom::Container::USER_PRIVATE_APP_LIST: |
| 102 return ash::kShellWindowId_AppListContainer; |
| 103 |
| 104 case mojom::Container::USER_PRIVATE_SYSTEM_MODAL: |
| 105 return ash::kShellWindowId_SystemModalContainer; |
| 106 |
| 107 case mojom::Container::LOGIN: |
| 108 return kUnknownAshId; |
| 109 |
| 110 case mojom::Container::LOGIN_WINDOWS: |
| 111 return kUnknownAshId; |
| 112 |
| 113 case mojom::Container::LOGIN_APP: |
| 114 return kUnknownAshId; |
| 115 |
| 116 case mojom::Container::LOGIN_SHELF: |
| 117 return kUnknownAshId; |
| 118 |
| 119 case mojom::Container::STATUS: |
| 120 return kUnknownAshId; |
| 121 |
| 122 case mojom::Container::BUBBLES: |
| 123 return kUnknownAshId; |
| 124 |
| 125 case mojom::Container::SYSTEM_MODAL_WINDOWS: |
| 126 return kUnknownAshId; |
| 127 |
| 128 case mojom::Container::KEYBOARD: |
| 129 return kUnknownAshId; |
| 130 |
| 131 case mojom::Container::MENUS: |
| 132 return ash::kShellWindowId_MenuContainer; |
| 133 |
| 134 case mojom::Container::DRAG_AND_TOOLTIPS: |
| 135 return ash::kShellWindowId_DragImageAndTooltipContainer; |
| 136 |
| 137 case mojom::Container::COUNT: |
| 138 return kUnknownAshId; |
| 139 } |
| 140 return kUnknownAshId; |
| 141 } |
| 142 |
| 143 } // namespace wm |
| 144 } // namespace mash |
OLD | NEW |