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