OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_AURA_WINDOW_PROPERTY_H_ | 5 #ifndef UI_AURA_WINDOW_PROPERTY_H_ |
6 #define UI_AURA_WINDOW_PROPERTY_H_ | 6 #define UI_AURA_WINDOW_PROPERTY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/aura/aura_export.h" | 9 #include "ui/aura/aura_export.h" |
10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } \ | 122 } \ |
123 const aura::WindowProperty<TYPE>* const NAME = & NAME ## _Value; | 123 const aura::WindowProperty<TYPE>* const NAME = & NAME ## _Value; |
124 | 124 |
125 #define DEFINE_LOCAL_WINDOW_PROPERTY_KEY(TYPE, NAME, DEFAULT) \ | 125 #define DEFINE_LOCAL_WINDOW_PROPERTY_KEY(TYPE, NAME, DEFAULT) \ |
126 namespace { \ | 126 namespace { \ |
127 const aura::WindowProperty<TYPE> NAME ## _Value = {DEFAULT, #NAME, NULL}; \ | 127 const aura::WindowProperty<TYPE> NAME ## _Value = {DEFAULT, #NAME, NULL}; \ |
128 const aura::WindowProperty<TYPE>* const NAME = & NAME ## _Value; \ | 128 const aura::WindowProperty<TYPE>* const NAME = & NAME ## _Value; \ |
129 } | 129 } |
130 | 130 |
131 #define DEFINE_OWNED_WINDOW_PROPERTY_KEY(TYPE, NAME, DEFAULT) \ | 131 #define DEFINE_OWNED_WINDOW_PROPERTY_KEY(TYPE, NAME, DEFAULT) \ |
132 namespace { \ | 132 namespace { \ |
133 enum { type_must_be_complete = sizeof(TYPE) }; \ | 133 void Deallocator ## NAME (intptr_t p) { \ |
134 void Deallocator(intptr_t p) { \ | 134 enum { type_must_be_complete = sizeof(TYPE) }; \ |
135 delete aura::WindowPropertyCaster<TYPE*>::FromIntptrT(p); \ | 135 delete aura::WindowPropertyCaster<TYPE*>::FromIntptrT(p); \ |
136 } \ | 136 } \ |
137 const aura::WindowProperty<TYPE*> NAME ## _Value = \ | 137 const aura::WindowProperty<TYPE*> NAME ## _Value = \ |
138 {DEFAULT,#NAME,&Deallocator}; \ | 138 {DEFAULT,#NAME,&Deallocator ## NAME}; \ |
139 } \ | 139 } \ |
140 const aura::WindowProperty<TYPE*>* const NAME = & NAME ## _Value; | 140 const aura::WindowProperty<TYPE*>* const NAME = & NAME ## _Value; |
141 | 141 |
142 #endif // UI_AURA_WINDOW_PROPERTY_H_ | 142 #endif // UI_AURA_WINDOW_PROPERTY_H_ |
OLD | NEW |