0

Update Metadata docs and comments.

Bug: 1485768
Change-Id: Id4a4488adf10de728d0278bb66dbd617e038e6c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5278430
Reviewed-by: David Yeung <dayeung@chromium.org>
Auto-Submit: Allen Bauer <kylixrd@chromium.org>
Commit-Queue: David Yeung <dayeung@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1258052}
This commit is contained in:
Allen Bauer
2024-02-08 18:45:30 +00:00
committed by Chromium LUCI CQ
parent 02d83d4c22
commit 64d99144d5
2 changed files with 11 additions and 10 deletions
docs/ui/views
ui/views

@ -22,7 +22,7 @@ In the header it is declared thusly:
```
class ASH_EXPORT MyViewClass : public views::View {
public:
METADATA_HEADER(MyViewClass);
METADATA_HEADER(MyViewClass, views::View);
// ... Public API goes here ...
@ -39,7 +39,7 @@ Then in the .cc file:
```
class MyViewClass::MyNestedView : public views::View {
public:
METADATA_HEADER(MyNestedView);
METADATA_HEADER(MyNestedView, views::View);
// ... Public API goes here …

@ -255,16 +255,17 @@ enum class ViewLayer {
//
// For Views that expose properties which are intended to be dynamically
// discoverable by other subsystems, each View and its descendants must
// include metadata. These other subsystems, such as dev tools or a delarative
// layout system, can then enumerate the properties on any given instance or
// class. Using the enumerated information, the actual values of the
// properties can be read or written. This will be done by getting and setting
// the values using string representations. The metadata can also be used to
// instantiate and initialize a View (or descendant) class from a declarative
// "script".
// include metadata. These other subsystems, such as dev tools or a
// declarative layout system, can then enumerate the properties on any given
// instance or class. Using the enumerated information, the actual values of
// the properties can be read or written. This will be done by getting and
// setting the values using string representations. The metadata can also be
// used to instantiate and initialize a View (or descendant) class from a
// declarative "script".
//
// For each View class in their respective header declaration, place the macro
// METADATA_HEADER(<classname>, <view ancestor class>) in the public section.
// METADATA_HEADER(<classname>, <view ancestor class>) in the initial private
// section.
//
// In the implementing .cc file, add the following macros to the same
// namespace in which the class resides.