| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_MUS_PROPERTY_CONVERTER_H_ | 5 #ifndef UI_AURA_MUS_PROPERTY_CONVERTER_H_ |
| 6 #define UI_AURA_MUS_PROPERTY_CONVERTER_H_ | 6 #define UI_AURA_MUS_PROPERTY_CONVERTER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 const char* transport_name) { | 58 const char* transport_name) { |
| 59 primitive_properties_[property] = | 59 primitive_properties_[property] = |
| 60 PropertyNames(property->name, transport_name); | 60 PropertyNames(property->name, transport_name); |
| 61 } | 61 } |
| 62 | 62 |
| 63 // Specializations for properties to pointer types supporting mojo conversion. | 63 // Specializations for properties to pointer types supporting mojo conversion. |
| 64 void RegisterProperty(const WindowProperty<gfx::Rect*>* property, | 64 void RegisterProperty(const WindowProperty<gfx::Rect*>* property, |
| 65 const char* transport_name); | 65 const char* transport_name); |
| 66 void RegisterProperty(const WindowProperty<std::string*>* property, | 66 void RegisterProperty(const WindowProperty<std::string*>* property, |
| 67 const char* transport_name); | 67 const char* transport_name); |
| 68 void RegisterProperty(const WindowProperty<base::string16*>* property, |
| 69 const char* transport_name); |
| 68 | 70 |
| 69 private: | 71 private: |
| 70 // A pair with the aura::WindowProperty::name and the mus property name. | 72 // A pair with the aura::WindowProperty::name and the mus property name. |
| 71 using PropertyNames = std::pair<const char*, const char*>; | 73 using PropertyNames = std::pair<const char*, const char*>; |
| 72 // A map of aura::WindowProperty<T> to its aura and mus property names. | 74 // A map of aura::WindowProperty<T> to its aura and mus property names. |
| 73 // This supports the internal codepaths for primitive types, eg. T=bool. | 75 // This supports the internal codepaths for primitive types, eg. T=bool. |
| 74 std::map<const void*, PropertyNames> primitive_properties_; | 76 std::map<const void*, PropertyNames> primitive_properties_; |
| 75 | 77 |
| 76 // Maps of aura::WindowProperty<T> to their mus property names. | 78 // Maps of aura::WindowProperty<T> to their mus property names. |
| 77 // This supports types that can be serialized for Mojo, eg. T=std::string*. | 79 // This supports types that can be serialized for Mojo, eg. T=std::string*. |
| 78 std::map<const WindowProperty<gfx::Rect*>*, const char*> rect_properties_; | 80 std::map<const WindowProperty<gfx::Rect*>*, const char*> rect_properties_; |
| 79 std::map<const WindowProperty<std::string*>*, const char*> string_properties_; | 81 std::map<const WindowProperty<std::string*>*, const char*> string_properties_; |
| 82 std::map<const WindowProperty<base::string16*>*, const char*> |
| 83 string16_properties_; |
| 80 | 84 |
| 81 DISALLOW_COPY_AND_ASSIGN(PropertyConverter); | 85 DISALLOW_COPY_AND_ASSIGN(PropertyConverter); |
| 82 }; | 86 }; |
| 83 | 87 |
| 84 } // namespace aura | 88 } // namespace aura |
| 85 | 89 |
| 86 #endif // UI_AURA_MUS_PROPERTY_CONVERTER_H_ | 90 #endif // UI_AURA_MUS_PROPERTY_CONVERTER_H_ |
| OLD | NEW |