| 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 "ui/aura/mus/property_utils.h" |
| 6 |
| 7 #include "services/ui/public/interfaces/window_manager_constants.mojom.h" |
| 8 #include "ui/aura/client/aura_constants.h" |
| 9 #include "ui/aura/window.h" |
| 10 #include "ui/wm/public/window_types.h" |
| 11 |
| 12 namespace aura { |
| 13 namespace { |
| 14 |
| 15 ui::wm::WindowType UiWindowTypeToWmWindowType(ui::mojom::WindowType type) { |
| 16 switch (type) { |
| 17 case ui::mojom::WindowType::WINDOW: |
| 18 return ui::wm::WINDOW_TYPE_NORMAL; |
| 19 case ui::mojom::WindowType::PANEL: |
| 20 return ui::wm::WINDOW_TYPE_PANEL; |
| 21 case ui::mojom::WindowType::CONTROL: |
| 22 return ui::wm::WINDOW_TYPE_CONTROL; |
| 23 case ui::mojom::WindowType::WINDOW_FRAMELESS: |
| 24 case ui::mojom::WindowType::POPUP: |
| 25 case ui::mojom::WindowType::BUBBLE: |
| 26 case ui::mojom::WindowType::DRAG: |
| 27 return ui::wm::WINDOW_TYPE_POPUP; |
| 28 case ui::mojom::WindowType::MENU: |
| 29 return ui::wm::WINDOW_TYPE_MENU; |
| 30 case ui::mojom::WindowType::TOOLTIP: |
| 31 return ui::wm::WINDOW_TYPE_TOOLTIP; |
| 32 case ui::mojom::WindowType::UNKNOWN: |
| 33 return ui::wm::WINDOW_TYPE_UNKNOWN; |
| 34 } |
| 35 NOTREACHED(); |
| 36 return ui::wm::WINDOW_TYPE_UNKNOWN; |
| 37 } |
| 38 |
| 39 } // namespace |
| 40 |
| 41 void SetWindowType(Window* window, ui::mojom::WindowType window_type) { |
| 42 window->SetProperty(client::kWindowTypeKey, window_type); |
| 43 window->SetType(UiWindowTypeToWmWindowType(window_type)); |
| 44 } |
| 45 |
| 46 } // namespace aura |
| OLD | NEW |