summaryrefslogtreecommitdiffstats
path: root/ui/views/mus/window_manager_constants_converters.cc
blob: 889737698f1915bce12d5c99c6445ee35ca7434f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/views/mus/window_manager_constants_converters.h"

namespace mojo {

// static
mus::mojom::WindowType
TypeConverter<mus::mojom::WindowType, views::Widget::InitParams::Type>::Convert(
    views::Widget::InitParams::Type type) {
  switch (type) {
    case views::Widget::InitParams::TYPE_WINDOW:
      return mus::mojom::WindowType::WINDOW;
    case views::Widget::InitParams::TYPE_PANEL:
      return mus::mojom::WindowType::PANEL;
    case views::Widget::InitParams::TYPE_WINDOW_FRAMELESS:
      return mus::mojom::WindowType::WINDOW_FRAMELESS;
    case views::Widget::InitParams::TYPE_CONTROL:
      return mus::mojom::WindowType::CONTROL;
    case views::Widget::InitParams::TYPE_POPUP:
      return mus::mojom::WindowType::POPUP;
    case views::Widget::InitParams::TYPE_MENU:
      return mus::mojom::WindowType::MENU;
    case views::Widget::InitParams::TYPE_TOOLTIP:
      return mus::mojom::WindowType::TOOLTIP;
    case views::Widget::InitParams::TYPE_BUBBLE:
      return mus::mojom::WindowType::BUBBLE;
    case views::Widget::InitParams::TYPE_DRAG:
      return mus::mojom::WindowType::DRAG;
  }
  return mus::mojom::WindowType::POPUP;
}

}  // namespace mojo