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

Unified Diff: mash/wm/property_util.cc

Issue 1848653006: Random wm frame painting fixes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: override Created 4 years, 9 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
« no previous file with comments | « mash/wm/property_util.h ('k') | mash/wm/window_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/wm/property_util.cc
diff --git a/mash/wm/property_util.cc b/mash/wm/property_util.cc
index a7d2797d0e172633bc8d44272e29ce3390766f77..010515b219ea960cc6860e937a81a11530b2c8e1 100644
--- a/mash/wm/property_util.cc
+++ b/mash/wm/property_util.cc
@@ -20,6 +20,12 @@ MUS_DEFINE_LOCAL_WINDOW_PROPERTY_KEY(Shadow*, kLocalShadowProperty, nullptr);
} // namespace
+void SetWindowShowState(mus::Window* window, mus::mojom::ShowState show_state) {
+ window->SetSharedProperty<int32_t>(
+ mus::mojom::WindowManager::kShowState_Property,
+ static_cast<uint32_t>(show_state));
+}
+
mus::mojom::ShowState GetWindowShowState(const mus::Window* window) {
if (window->HasSharedProperty(
mus::mojom::WindowManager::kShowState_Property)) {
@@ -98,12 +104,18 @@ void SetShadow(mus::Window* window, Shadow* shadow) {
window->SetLocalProperty(kLocalShadowProperty, shadow);
}
-Shadow* GetShadow(mus::Window* window) {
+Shadow* GetShadow(const mus::Window* window) {
return window->GetLocalProperty(kLocalShadowProperty);
}
-mus::mojom::WindowType GetWindowType(mus::Window* window) {
- return GetWindowType(window->shared_properties());
+mus::mojom::WindowType GetWindowType(const mus::Window* window) {
+ if (window->HasSharedProperty(
+ mus::mojom::WindowManager::kWindowType_Property)) {
+ return static_cast<mus::mojom::WindowType>(
+ window->GetSharedProperty<int32_t>(
+ mus::mojom::WindowManager::kWindowType_Property));
+ }
+ return mus::mojom::WindowType::POPUP;
}
mus::mojom::WindowType GetWindowType(
@@ -117,5 +129,15 @@ mus::mojom::WindowType GetWindowType(
return mus::mojom::WindowType::POPUP;
}
+base::string16 GetWindowTitle(const mus::Window* window) {
+ if (!window->HasSharedProperty(
+ mus::mojom::WindowManager::kWindowTitle_Property)) {
+ return base::string16();
+ }
+
+ return window->GetSharedProperty<base::string16>(
+ mus::mojom::WindowManager::kWindowTitle_Property);
+}
+
} // namespace wm
} // namespace mash
« no previous file with comments | « mash/wm/property_util.h ('k') | mash/wm/window_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698