Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1125)

Side by Side Diff: ui/aura/mus/property_utils.cc

Issue 2514243002: Propagates window type properties during aura-mus window creation (Closed)
Patch Set: merge Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/aura/mus/property_utils.h ('k') | ui/aura/mus/window_manager_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « ui/aura/mus/property_utils.h ('k') | ui/aura/mus/window_manager_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698