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

Unified Diff: ui/views/widget/desktop_aura/desktop_native_widget_property.cc

Issue 801953002: Use template specialization to generate WindowProperty code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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: ui/views/widget/desktop_aura/desktop_native_widget_property.cc
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_property.cc b/ui/views/widget/desktop_aura/desktop_native_widget_property.cc
new file mode 100644
index 0000000000000000000000000000000000000000..6e83ff7732f6a8dc7dc92bdb9178b5a23f087821
--- /dev/null
+++ b/ui/views/widget/desktop_aura/desktop_native_widget_property.cc
@@ -0,0 +1,28 @@
+// Copyright 2014 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 "ui/aura/window_property.h"
+#include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h"
+
+DECLARE_WINDOW_PROPERTY_TYPE(views::DesktopNativeWidgetAura*);
+
+namespace views {
+
+DEFINE_WINDOW_PROPERTY_KEY(DesktopNativeWidgetAura*,
+ kDesktopNativeWidgetAuraKey, NULL);
+
+// static
+DesktopNativeWidgetAura* DesktopNativeWidgetAura::ForWindow(
+ aura::Window* window) {
+ return window->GetProperty(kDesktopNativeWidgetAuraKey);
+}
+
+// static
+void DesktopNativeWidgetAura::SetForWindow(
+ aura::Window* window,
+ DesktopNativeWidgetAura* desktop_native_widget) {
+ window->SetProperty(kDesktopNativeWidgetAuraKey, desktop_native_widget);
+}
+
+} // namespace views

Powered by Google App Engine
This is Rietveld 408576698