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

Unified Diff: ash/public/cpp/shelf_types.cc

Issue 2702423004: Validate incoming window properties. (Closed)
Patch Set: rebase to tot 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
Index: ash/public/cpp/shelf_types.cc
diff --git a/ash/public/cpp/shelf_types.cc b/ash/public/cpp/shelf_types.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8922bd9cbe717653ec55807484c2fc2f5c89eabc
--- /dev/null
+++ b/ash/public/cpp/shelf_types.cc
@@ -0,0 +1,26 @@
+// Copyright 2017 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 "ash/public/cpp/shelf_types.h"
+
+#include "base/bind.h"
+#include "base/callback.h"
+
+namespace ash {
+
+namespace {
+
+bool DoValidateShelfItemType(int32_t i) {
+ return i == TYPE_APP_PANEL || i == TYPE_APP_SHORTCUT || i == TYPE_APP_LIST ||
+ i == TYPE_BROWSER_SHORTCUT || i == TYPE_APP || i == TYPE_DIALOG ||
+ i == TYPE_UNDEFINED;
+}
+
+} // namespace
+
+base::RepeatingCallback<bool(int32_t)> ValidateShelfItemType() {
+ return base::Bind(&DoValidateShelfItemType);
+}
+
+} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698