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

Unified Diff: mash/wm/property_util.cc

Issue 1954933002: Initial cut of ash/wm/common classes for mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WmWindowMus::GetGlobals Created 4 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: mash/wm/property_util.cc
diff --git a/mash/wm/property_util.cc b/mash/wm/property_util.cc
index e8355fd57e4a665406dcb3d3cc9944a7a1a06937..a488a325b36cc96e050790d4e9e30ba7efdb99ee 100644
--- a/mash/wm/property_util.cc
+++ b/mash/wm/property_util.cc
@@ -33,7 +33,7 @@ mus::mojom::ShowState GetWindowShowState(const mus::Window* window) {
window->GetSharedProperty<int32_t>(
mus::mojom::WindowManager::kShowState_Property));
}
- return mus::mojom::ShowState::RESTORED;
+ return mus::mojom::ShowState::DEFAULT;
}
void SetWindowUserSetBounds(mus::Window* window, const gfx::Rect& bounds) {
@@ -129,6 +129,33 @@ mus::mojom::WindowType GetWindowType(
return mus::mojom::WindowType::POPUP;
}
+ui::wm::WindowType GetWmWindowType(const mus::Window* window) {
+ switch (GetWindowType(window)) {
+ case mus::mojom::WindowType::WINDOW:
+ return ui::wm::WINDOW_TYPE_NORMAL;
+
+ case mus::mojom::WindowType::PANEL:
+ return ui::wm::WINDOW_TYPE_PANEL;
+
+ case mus::mojom::WindowType::CONTROL:
+ return ui::wm::WINDOW_TYPE_CONTROL;
+
+ case mus::mojom::WindowType::WINDOW_FRAMELESS:
+ case mus::mojom::WindowType::POPUP:
+ case mus::mojom::WindowType::BUBBLE:
+ case mus::mojom::WindowType::DRAG:
+ return ui::wm::WINDOW_TYPE_POPUP;
+
+ case mus::mojom::WindowType::MENU:
+ return ui::wm::WINDOW_TYPE_MENU;
+
+ case mus::mojom::WindowType::TOOLTIP:
+ return ui::wm::WINDOW_TYPE_TOOLTIP;
+ }
+
+ return ui::wm::WINDOW_TYPE_UNKNOWN;
+}
+
base::string16 GetWindowTitle(const mus::Window* window) {
if (!window->HasSharedProperty(
mus::mojom::WindowManager::kWindowTitle_Property)) {

Powered by Google App Engine
This is Rietveld 408576698