Chromium Code Reviews| 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 mojom::Container::USER_PRIVATE_CONTAINER, | |
| 14 // Bubble windows must be allowed to activate because some of them rely on | |
| 15 // deactivation to close. | |
| 16 mojom::Container::BUBBLES, | |
| 17 }; | |
|
James Cook
2016/05/13 17:14:44
Do login windows need to be able to activate?
sky
2016/05/13 19:14:06
I think this list is woefully wrong. I added a TOD
| |
| 18 | |
| 19 const size_t kNumActivationContainers = arraysize(kActivationContainers); | |
| 20 | |
| 21 mojom::Container AshContainerToMashContainer(int ash_id) { | |
| 22 switch (ash_id) { | |
| 23 case ash::kShellWindowId_UnparentedControlContainer: | |
| 24 case ash::kShellWindowId_LockScreenContainer: | |
| 25 case ash::kShellWindowId_LockSystemModalContainer: | |
| 26 // We should never be asked to parent windows of these types. | |
| 27 NOTREACHED(); | |
| 28 return mojom::Container::USER_PRIVATE_CONTAINER; | |
| 29 | |
| 30 case ash::kShellWindowId_DefaultContainer: | |
| 31 return mojom::Container::USER_PRIVATE_WINDOWS; | |
| 32 | |
| 33 case ash::kShellWindowId_AlwaysOnTopContainer: | |
| 34 return mojom::Container::USER_PRIVATE_ALWAYS_ON_TOP_WINDOWS; | |
| 35 | |
| 36 case ash::kShellWindowId_DockedContainer: | |
| 37 return mojom::Container::USER_PRIVATE_DOCKED_WINDOWS; | |
| 38 | |
| 39 case ash::kShellWindowId_ShelfContainer: | |
| 40 return mojom::Container::USER_PRIVATE_SHELF; | |
| 41 | |
| 42 case ash::kShellWindowId_PanelContainer: | |
| 43 return mojom::Container::USER_PRIVATE_PANELS; | |
| 44 | |
| 45 case ash::kShellWindowId_AppListContainer: | |
| 46 return mojom::Container::USER_PRIVATE_APP_LIST; | |
| 47 | |
| 48 case ash::kShellWindowId_SystemModalContainer: | |
| 49 return mojom::Container::USER_PRIVATE_SYSTEM_MODAL; | |
| 50 | |
| 51 case ash::kShellWindowId_MenuContainer: | |
| 52 return mojom::Container::MENUS; | |
| 53 | |
| 54 case ash::kShellWindowId_DragImageAndTooltipContainer: | |
| 55 return mojom::Container::DRAG_AND_TOOLTIPS; | |
| 56 | |
| 57 default: | |
| 58 NOTREACHED(); | |
| 59 } | |
| 60 return mojom::Container::ALL_USER_BACKGROUND; | |
|
James Cook
2016/05/13 17:14:44
If there's a bug where a window defaults to this,
sky
2016/05/13 19:14:06
Made it return USER_PRIVATE_WINDOWS.
| |
| 61 } | |
| 62 | |
| 63 int MashContainerToAshContainer(mojom::Container container) { | |
| 64 switch (container) { | |
| 65 case mojom::Container::ROOT_CONTAINER: | |
| 66 return kUnknownAshId; | |
| 67 | |
| 68 case mojom::Container::ALL_USER_BACKGROUND: | |
| 69 return kUnknownAshId; | |
| 70 | |
| 71 case mojom::Container::USER_CONTAINER: | |
| 72 return kUnknownAshId; | |
| 73 | |
| 74 case mojom::Container::USER_BACKGROUND: | |
| 75 return kUnknownAshId; | |
| 76 | |
| 77 case mojom::Container::USER_PRIVATE_CONTAINER: | |
| 78 return kUnknownAshId; | |
| 79 | |
| 80 case mojom::Container::USER_PRIVATE_WINDOWS: | |
| 81 return ash::kShellWindowId_DefaultContainer; | |
| 82 | |
| 83 case mojom::Container::USER_PRIVATE_ALWAYS_ON_TOP_WINDOWS: | |
| 84 return ash::kShellWindowId_AlwaysOnTopContainer; | |
| 85 | |
| 86 case mojom::Container::USER_PRIVATE_DOCKED_WINDOWS: | |
| 87 return ash::kShellWindowId_DockedContainer; | |
| 88 | |
| 89 case mojom::Container::USER_PRIVATE_PRESENTATION_WINDOWS: | |
| 90 | |
|
James Cook
2016/05/13 17:14:44
Something should go here.
sky
2016/05/13 19:14:06
Done.
| |
| 91 case mojom::Container::USER_PRIVATE_SHELF: | |
| 92 return ash::kShellWindowId_ShelfContainer; | |
| 93 | |
| 94 case mojom::Container::USER_PRIVATE_PANELS: | |
| 95 return ash::kShellWindowId_PanelContainer; | |
| 96 | |
| 97 case mojom::Container::USER_PRIVATE_APP_LIST: | |
| 98 return ash::kShellWindowId_AppListContainer; | |
| 99 | |
| 100 case mojom::Container::USER_PRIVATE_SYSTEM_MODAL: | |
| 101 return ash::kShellWindowId_SystemModalContainer; | |
| 102 | |
| 103 case mojom::Container::LOGIN_CONTAINER: | |
| 104 return kUnknownAshId; | |
| 105 | |
| 106 case mojom::Container::LOGIN_WINDOWS: | |
| 107 return kUnknownAshId; | |
| 108 | |
| 109 case mojom::Container::LOGIN_APP: | |
| 110 return kUnknownAshId; | |
| 111 | |
| 112 case mojom::Container::LOGIN_SHELF: | |
| 113 return kUnknownAshId; | |
| 114 | |
| 115 case mojom::Container::STATUS: | |
| 116 return kUnknownAshId; | |
|
James Cook
2016/05/13 17:14:44
Do you want to move more IDs into ash/wm/common/wm
sky
2016/05/13 19:14:06
At this point wm_shell_window_ids is just the ids
| |
| 117 | |
| 118 case mojom::Container::BUBBLES: | |
| 119 return kUnknownAshId; | |
| 120 | |
| 121 case mojom::Container::SYSTEM_MODAL_WINDOWS: | |
| 122 return kUnknownAshId; | |
|
James Cook
2016/05/13 17:14:44
kShellWindowId_SystemModalContainer? (It's already
sky
2016/05/13 19:14:06
SYSTEM_MODAL_WINDOWS is intended for non user spec
| |
| 123 | |
| 124 case mojom::Container::KEYBOARD: | |
| 125 return kUnknownAshId; | |
| 126 | |
| 127 case mojom::Container::MENUS: | |
| 128 return ash::kShellWindowId_MenuContainer; | |
| 129 | |
| 130 case mojom::Container::DRAG_AND_TOOLTIPS: | |
| 131 return ash::kShellWindowId_DragImageAndTooltipContainer; | |
| 132 | |
| 133 case mojom::Container::COUNT: | |
| 134 return kUnknownAshId; | |
| 135 } | |
| 136 return kUnknownAshId; | |
| 137 } | |
| 138 | |
| 139 } // namespace wm | |
| 140 } // namespace mash | |
| OLD | NEW |