| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_MUS_PUBLIC_CPP_WINDOW_PROPERTY_H_ | 5 #ifndef SERVICES_UI_PUBLIC_CPP_WINDOW_PROPERTY_H_ |
| 6 #define COMPONENTS_MUS_PUBLIC_CPP_WINDOW_PROPERTY_H_ | 6 #define SERVICES_UI_PUBLIC_CPP_WINDOW_PROPERTY_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 // To define a new WindowProperty: | 10 // To define a new WindowProperty: |
| 11 // | 11 // |
| 12 // #include "components/mus/public/cpp/window_property.h" | 12 // #include "services/ui/public/cpp/window_property.h" |
| 13 // | 13 // |
| 14 // MUS_DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(FOO_EXPORT, MyType); | 14 // MUS_DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(FOO_EXPORT, MyType); |
| 15 // namespace foo { | 15 // namespace foo { |
| 16 // // Use this to define an exported property that is primitive, | 16 // // Use this to define an exported property that is primitive, |
| 17 // // or a pointer you don't want automatically deleted. | 17 // // or a pointer you don't want automatically deleted. |
| 18 // MUS_DEFINE_WINDOW_PROPERTY_KEY(MyType, kMyKey, MyDefault); | 18 // MUS_DEFINE_WINDOW_PROPERTY_KEY(MyType, kMyKey, MyDefault); |
| 19 // | 19 // |
| 20 // // Use this to define an exported property whose value is a heap | 20 // // Use this to define an exported property whose value is a heap |
| 21 // // allocated object, and has to be owned and freed by the window. | 21 // // allocated object, and has to be owned and freed by the window. |
| 22 // MUS_DEFINE_OWNED_WINDOW_PROPERTY_KEY(gfx::Rect, kRestoreBoundsKey, | 22 // MUS_DEFINE_OWNED_WINDOW_PROPERTY_KEY(gfx::Rect, kRestoreBoundsKey, |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 namespace { \ | 146 namespace { \ |
| 147 void Deallocator##NAME(int64_t p) { \ | 147 void Deallocator##NAME(int64_t p) { \ |
| 148 enum { type_must_be_complete = sizeof(TYPE) }; \ | 148 enum { type_must_be_complete = sizeof(TYPE) }; \ |
| 149 delete mus::WindowPropertyCaster<TYPE*>::FromInt64(p); \ | 149 delete mus::WindowPropertyCaster<TYPE*>::FromInt64(p); \ |
| 150 } \ | 150 } \ |
| 151 const mus::WindowProperty<TYPE*> NAME##_Value = {DEFAULT, #NAME, \ | 151 const mus::WindowProperty<TYPE*> NAME##_Value = {DEFAULT, #NAME, \ |
| 152 &Deallocator##NAME}; \ | 152 &Deallocator##NAME}; \ |
| 153 } \ | 153 } \ |
| 154 const mus::WindowProperty<TYPE*>* const NAME = &NAME##_Value; | 154 const mus::WindowProperty<TYPE*>* const NAME = &NAME##_Value; |
| 155 | 155 |
| 156 #endif // COMPONENTS_MUS_PUBLIC_CPP_WINDOW_PROPERTY_H_ | 156 #endif // SERVICES_UI_PUBLIC_CPP_WINDOW_PROPERTY_H_ |
| OLD | NEW |