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

Unified Diff: ui/wm/core/shadow_types.cc

Issue 2702423004: Validate incoming window properties. (Closed)
Patch Set: sky comments Created 3 years, 10 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 | « ui/wm/core/shadow_types.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/shadow_types.cc
diff --git a/ui/wm/core/shadow_types.cc b/ui/wm/core/shadow_types.cc
index bf08bbec57e5b72081f292049f2ed898906fac4c..3f53d1b40659824c1efee68e2ebbcb59be583a71 100644
--- a/ui/wm/core/shadow_types.cc
+++ b/ui/wm/core/shadow_types.cc
@@ -18,4 +18,12 @@ void SetShadowElevation(aura::Window* window, ShadowElevation elevation) {
window->SetProperty(kShadowElevationKey, elevation);
}
+bool IsValidShadowElevation(int64_t value) {
+ return value == int64_t(ShadowElevation::DEFAULT) ||
+ value == int64_t(ShadowElevation::NONE) ||
+ value == int64_t(ShadowElevation::SMALL) ||
+ value == int64_t(ShadowElevation::MEDIUM) ||
+ value == int64_t(ShadowElevation::LARGE);
+}
+
} // namespace wm
« no previous file with comments | « ui/wm/core/shadow_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698