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

Unified Diff: ui/aura/mus/property_converter.h

Issue 2538633002: Adds a couple more properties to the property converter (Closed)
Patch Set: merge again Created 4 years, 1 month 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
« no previous file with comments | « ui/aura/client/aura_constants.cc ('k') | ui/aura/mus/property_converter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/mus/property_converter.h
diff --git a/ui/aura/mus/property_converter.h b/ui/aura/mus/property_converter.h
index 51c190be2becbde17470516bb644a07c0de23778..8a2c7697cd04523f5adae8acf49f97a655819802 100644
--- a/ui/aura/mus/property_converter.h
+++ b/ui/aura/mus/property_converter.h
@@ -18,6 +18,7 @@
namespace gfx {
class Rect;
+class Size;
}
namespace aura {
@@ -29,6 +30,9 @@ namespace aura {
// Window properties.
class AURA_EXPORT PropertyConverter {
public:
+ // All primitive values are stored using this type.
+ using PrimitiveType = int64_t;
+
PropertyConverter();
~PropertyConverter();
@@ -52,6 +56,16 @@ class AURA_EXPORT PropertyConverter {
const std::string& transport_name,
const std::vector<uint8_t>* transport_data);
+ // Returns the value for a particular transport value. All primitives are
+ // serialized as a PrimitiveType, so this function may be used for any
+ // primitive. Returns true on success and sets |value| accordingly. A return
+ // value of false indicates the value isn't known or the property type isn't
+ // primitive.
+ bool GetPropertyValueFromTransportValue(
+ const std::string& transport_name,
+ const std::vector<uint8_t>& transport_data,
+ PrimitiveType* value);
+
// Register a property to support conversion between mus and aura.
template<typename T>
void RegisterProperty(const WindowProperty<T>* property,
@@ -65,6 +79,8 @@ class AURA_EXPORT PropertyConverter {
const char* transport_name);
void RegisterProperty(const WindowProperty<gfx::Rect*>* property,
const char* transport_name);
+ void RegisterProperty(const WindowProperty<gfx::Size*>* property,
+ const char* transport_name);
void RegisterProperty(const WindowProperty<std::string*>* property,
const char* transport_name);
void RegisterProperty(const WindowProperty<base::string16*>* property,
@@ -82,6 +98,7 @@ class AURA_EXPORT PropertyConverter {
std::map<const WindowProperty<gfx::ImageSkia*>*, const char*>
image_properties_;
std::map<const WindowProperty<gfx::Rect*>*, const char*> rect_properties_;
+ std::map<const WindowProperty<gfx::Size*>*, const char*> size_properties_;
std::map<const WindowProperty<std::string*>*, const char*> string_properties_;
std::map<const WindowProperty<base::string16*>*, const char*>
string16_properties_;
« no previous file with comments | « ui/aura/client/aura_constants.cc ('k') | ui/aura/mus/property_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698