Commit e6975c78 authored by msw's avatar msw Committed by Commit bot

mash: Add type names to PropertyConverter::Register*Property.

Came up in https://codereview.chromium.org/2878133002/
(calling the wrong function ate up 1hr+ debugging)
(this cl also depends on that one)

BUG=NONE
TEST=NONE
R=sky@chromium.org
NOTRY=true

Review-Url: https://codereview.chromium.org/2889443002
Cr-Commit-Position: refs/heads/master@{#472239}
parent 9b38f0b5
...@@ -82,25 +82,25 @@ WindowManager::WindowManager(service_manager::Connector* connector, ...@@ -82,25 +82,25 @@ WindowManager::WindowManager(service_manager::Connector* connector,
show_primary_host_on_connect_(show_primary_host_on_connect), show_primary_host_on_connect_(show_primary_host_on_connect),
wm_state_(base::MakeUnique<::wm::WMState>()), wm_state_(base::MakeUnique<::wm::WMState>()),
property_converter_(base::MakeUnique<aura::PropertyConverter>()) { property_converter_(base::MakeUnique<aura::PropertyConverter>()) {
property_converter_->RegisterProperty( property_converter_->RegisterPrimitiveProperty(
kPanelAttachedKey, ui::mojom::WindowManager::kPanelAttached_Property, kPanelAttachedKey, ui::mojom::WindowManager::kPanelAttached_Property,
aura::PropertyConverter::CreateAcceptAnyValueCallback()); aura::PropertyConverter::CreateAcceptAnyValueCallback());
property_converter_->RegisterProperty( property_converter_->RegisterPrimitiveProperty(
kRenderTitleAreaProperty, kRenderTitleAreaProperty,
ui::mojom::WindowManager::kRenderParentTitleArea_Property, ui::mojom::WindowManager::kRenderParentTitleArea_Property,
aura::PropertyConverter::CreateAcceptAnyValueCallback()); aura::PropertyConverter::CreateAcceptAnyValueCallback());
property_converter_->RegisterProperty( property_converter_->RegisterPrimitiveProperty(
kShelfIDKey, ui::mojom::WindowManager::kShelfID_Property);
property_converter_->RegisterProperty(
kShelfItemTypeKey, ui::mojom::WindowManager::kShelfItemType_Property, kShelfItemTypeKey, ui::mojom::WindowManager::kShelfItemType_Property,
base::Bind(&IsValidShelfItemType)); base::Bind(&IsValidShelfItemType));
property_converter_->RegisterProperty( property_converter_->RegisterPrimitiveProperty(
::wm::kShadowElevationKey, ::wm::kShadowElevationKey,
ui::mojom::WindowManager::kShadowElevation_Property, ui::mojom::WindowManager::kShadowElevation_Property,
base::Bind(&::wm::IsValidShadowElevation)); base::Bind(&::wm::IsValidShadowElevation));
property_converter_->RegisterProperty(kWindowPinTypeKey, property_converter_->RegisterPrimitiveProperty(
ash::mojom::kWindowPinType_Property, kWindowPinTypeKey, ash::mojom::kWindowPinType_Property,
base::Bind(&ash::IsValidWindowPinType)); base::Bind(&ash::IsValidWindowPinType));
property_converter_->RegisterStringProperty(
kShelfIDKey, ui::mojom::WindowManager::kShelfID_Property);
} }
WindowManager::~WindowManager() { WindowManager::~WindowManager() {
......
...@@ -49,19 +49,19 @@ void ChromeBrowserMainExtraPartsAsh::ServiceManagerConnectionStarted( ...@@ -49,19 +49,19 @@ void ChromeBrowserMainExtraPartsAsh::ServiceManagerConnectionStarted(
aura::WindowTreeClientDelegate* delegate = mus_client; aura::WindowTreeClientDelegate* delegate = mus_client;
aura::PropertyConverter* converter = delegate->GetPropertyConverter(); aura::PropertyConverter* converter = delegate->GetPropertyConverter();
converter->RegisterProperty( converter->RegisterPrimitiveProperty(
ash::kPanelAttachedKey, ash::kPanelAttachedKey,
ui::mojom::WindowManager::kPanelAttached_Property, ui::mojom::WindowManager::kPanelAttached_Property,
aura::PropertyConverter::CreateAcceptAnyValueCallback()); aura::PropertyConverter::CreateAcceptAnyValueCallback());
converter->RegisterProperty(ash::kShelfIDKey, converter->RegisterPrimitiveProperty(
ui::mojom::WindowManager::kShelfID_Property);
converter->RegisterProperty(
ash::kShelfItemTypeKey, ash::kShelfItemTypeKey,
ui::mojom::WindowManager::kShelfItemType_Property, ui::mojom::WindowManager::kShelfItemType_Property,
base::Bind(&ash::IsValidShelfItemType)); base::Bind(&ash::IsValidShelfItemType));
converter->RegisterProperty(ash::kWindowPinTypeKey, converter->RegisterPrimitiveProperty(
ash::mojom::kWindowPinType_Property, ash::kWindowPinTypeKey, ash::mojom::kWindowPinType_Property,
base::Bind(&ash::IsValidWindowPinType)); base::Bind(&ash::IsValidWindowPinType));
converter->RegisterStringProperty(
ash::kShelfIDKey, ui::mojom::WindowManager::kShelfID_Property);
mus_client->SetMusPropertyMirror( mus_client->SetMusPropertyMirror(
base::MakeUnique<ash::MusPropertyMirrorAsh>()); base::MakeUnique<ash::MusPropertyMirrorAsh>());
......
...@@ -66,28 +66,30 @@ PropertyConverter::CreateAcceptAnyValueCallback() { ...@@ -66,28 +66,30 @@ PropertyConverter::CreateAcceptAnyValueCallback() {
PropertyConverter::PropertyConverter() { PropertyConverter::PropertyConverter() {
// Add known aura properties with associated mus properties. // Add known aura properties with associated mus properties.
RegisterProperty(client::kAlwaysOnTopKey, RegisterImageSkiaProperty(client::kAppIconKey,
ui::mojom::WindowManager::kAppIcon_Property);
RegisterImageSkiaProperty(client::kWindowIconKey,
ui::mojom::WindowManager::kWindowIcon_Property);
RegisterPrimitiveProperty(client::kAlwaysOnTopKey,
ui::mojom::WindowManager::kAlwaysOnTop_Property, ui::mojom::WindowManager::kAlwaysOnTop_Property,
CreateAcceptAnyValueCallback()); CreateAcceptAnyValueCallback());
RegisterProperty(client::kAppIconKey, RegisterPrimitiveProperty(
ui::mojom::WindowManager::kAppIcon_Property); client::kImmersiveFullscreenKey,
RegisterProperty(client::kImmersiveFullscreenKey,
ui::mojom::WindowManager::kImmersiveFullscreen_Property, ui::mojom::WindowManager::kImmersiveFullscreen_Property,
CreateAcceptAnyValueCallback()); CreateAcceptAnyValueCallback());
RegisterProperty(client::kNameKey, ui::mojom::WindowManager::kName_Property); RegisterPrimitiveProperty(client::kResizeBehaviorKey,
RegisterProperty(client::kPreferredSize,
ui::mojom::WindowManager::kPreferredSize_Property);
RegisterProperty(client::kResizeBehaviorKey,
ui::mojom::WindowManager::kResizeBehavior_Property, ui::mojom::WindowManager::kResizeBehavior_Property,
base::Bind(&ValidateResizeBehaviour)); base::Bind(&ValidateResizeBehaviour));
RegisterProperty(client::kRestoreBoundsKey, RegisterPrimitiveProperty(client::kShowStateKey,
ui::mojom::WindowManager::kRestoreBounds_Property);
RegisterProperty(client::kShowStateKey,
ui::mojom::WindowManager::kShowState_Property, ui::mojom::WindowManager::kShowState_Property,
base::Bind(&ValidateShowState)); base::Bind(&ValidateShowState));
RegisterProperty(client::kWindowIconKey, RegisterRectProperty(client::kRestoreBoundsKey,
ui::mojom::WindowManager::kWindowIcon_Property); ui::mojom::WindowManager::kRestoreBounds_Property);
RegisterProperty(client::kTitleKey, RegisterSizeProperty(client::kPreferredSize,
ui::mojom::WindowManager::kPreferredSize_Property);
RegisterStringProperty(client::kNameKey,
ui::mojom::WindowManager::kName_Property);
RegisterString16Property(client::kTitleKey,
ui::mojom::WindowManager::kWindowTitle_Property); ui::mojom::WindowManager::kWindowTitle_Property);
} }
...@@ -288,35 +290,35 @@ bool PropertyConverter::GetPropertyValueFromTransportValue( ...@@ -288,35 +290,35 @@ bool PropertyConverter::GetPropertyValueFromTransportValue(
return false; return false;
} }
void PropertyConverter::RegisterProperty( void PropertyConverter::RegisterImageSkiaProperty(
const WindowProperty<gfx::ImageSkia*>* property, const WindowProperty<gfx::ImageSkia*>* property,
const char* transport_name) { const char* transport_name) {
image_properties_[property] = transport_name; image_properties_[property] = transport_name;
transport_names_.insert(transport_name); transport_names_.insert(transport_name);
} }
void PropertyConverter::RegisterProperty( void PropertyConverter::RegisterRectProperty(
const WindowProperty<gfx::Rect*>* property, const WindowProperty<gfx::Rect*>* property,
const char* transport_name) { const char* transport_name) {
rect_properties_[property] = transport_name; rect_properties_[property] = transport_name;
transport_names_.insert(transport_name); transport_names_.insert(transport_name);
} }
void PropertyConverter::RegisterProperty( void PropertyConverter::RegisterSizeProperty(
const WindowProperty<gfx::Size*>* property, const WindowProperty<gfx::Size*>* property,
const char* transport_name) { const char* transport_name) {
size_properties_[property] = transport_name; size_properties_[property] = transport_name;
transport_names_.insert(transport_name); transport_names_.insert(transport_name);
} }
void PropertyConverter::RegisterProperty( void PropertyConverter::RegisterStringProperty(
const WindowProperty<std::string*>* property, const WindowProperty<std::string*>* property,
const char* transport_name) { const char* transport_name) {
string_properties_[property] = transport_name; string_properties_[property] = transport_name;
transport_names_.insert(transport_name); transport_names_.insert(transport_name);
} }
void PropertyConverter::RegisterProperty( void PropertyConverter::RegisterString16Property(
const WindowProperty<base::string16*>* property, const WindowProperty<base::string16*>* property,
const char* transport_name) { const char* transport_name) {
string16_properties_[property] = transport_name; string16_properties_[property] = transport_name;
......
...@@ -78,9 +78,8 @@ class AURA_EXPORT PropertyConverter { ...@@ -78,9 +78,8 @@ class AURA_EXPORT PropertyConverter {
// Register a property to support conversion between mus and aura. // Register a property to support conversion between mus and aura.
// |validator| is a callback used to validate incoming values from // |validator| is a callback used to validate incoming values from
// transport_data; if it returns false, the value is rejected. // transport_data; if it returns false, the value is rejected.
// TODO(msw): Include type names in RegisterProperty function names.
template <typename T> template <typename T>
void RegisterProperty( void RegisterPrimitiveProperty(
const WindowProperty<T>* property, const WindowProperty<T>* property,
const char* transport_name, const char* transport_name,
const base::RepeatingCallback<bool(int64_t)>& validator) { const base::RepeatingCallback<bool(int64_t)>& validator) {
...@@ -95,16 +94,16 @@ class AURA_EXPORT PropertyConverter { ...@@ -95,16 +94,16 @@ class AURA_EXPORT PropertyConverter {
} }
// Register owned properties to support conversion between mus and aura. // Register owned properties to support conversion between mus and aura.
// TODO(msw): Include type names in RegisterProperty function names. void RegisterImageSkiaProperty(
void RegisterProperty(const WindowProperty<gfx::ImageSkia*>* property, const WindowProperty<gfx::ImageSkia*>* property,
const char* transport_name); const char* transport_name);
void RegisterProperty(const WindowProperty<gfx::Rect*>* property, void RegisterRectProperty(const WindowProperty<gfx::Rect*>* property,
const char* transport_name); const char* transport_name);
void RegisterProperty(const WindowProperty<gfx::Size*>* property, void RegisterSizeProperty(const WindowProperty<gfx::Size*>* property,
const char* transport_name); const char* transport_name);
void RegisterProperty(const WindowProperty<std::string*>* property, void RegisterStringProperty(const WindowProperty<std::string*>* property,
const char* transport_name); const char* transport_name);
void RegisterProperty(const WindowProperty<base::string16*>* property, void RegisterString16Property(const WindowProperty<base::string16*>* property,
const char* transport_name); const char* transport_name);
private: private:
......
...@@ -43,7 +43,8 @@ DEFINE_UI_CLASS_PROPERTY_KEY(int16_t, kTestPropertyKey7, 1); ...@@ -43,7 +43,8 @@ DEFINE_UI_CLASS_PROPERTY_KEY(int16_t, kTestPropertyKey7, 1);
DEFINE_UI_CLASS_PROPERTY_KEY(int32_t, kTestPropertyKey8, -1); DEFINE_UI_CLASS_PROPERTY_KEY(int32_t, kTestPropertyKey8, -1);
DEFINE_UI_CLASS_PROPERTY_KEY(int64_t, kTestPropertyKey9, 777); DEFINE_UI_CLASS_PROPERTY_KEY(int64_t, kTestPropertyKey9, 777);
DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::ImageSkia, kTestImagePropertyKey, DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::ImageSkia,
kTestImageSkiaPropertyKey,
nullptr); nullptr);
DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::Rect, kTestRectPropertyKey, nullptr); DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::Rect, kTestRectPropertyKey, nullptr);
DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::Size, kTestSizePropertyKey, nullptr); DEFINE_OWNED_UI_CLASS_PROPERTY_KEY(gfx::Size, kTestSizePropertyKey, nullptr);
...@@ -63,7 +64,7 @@ const char kTestPropertyServerKey7[] = "test-property-server7"; ...@@ -63,7 +64,7 @@ const char kTestPropertyServerKey7[] = "test-property-server7";
const char kTestPropertyServerKey8[] = "test-property-server8"; const char kTestPropertyServerKey8[] = "test-property-server8";
const char kTestPropertyServerKey9[] = "test-property-server9"; const char kTestPropertyServerKey9[] = "test-property-server9";
const char kTestImagePropertyServerKey[] = "test-image-property-server"; const char kTestImageSkiaPropertyServerKey[] = "test-imageskia-property-server";
const char kTestRectPropertyServerKey[] = "test-rect-property-server"; const char kTestRectPropertyServerKey[] = "test-rect-property-server";
const char kTestSizePropertyServerKey[] = "test-size-property-server"; const char kTestSizePropertyServerKey[] = "test-size-property-server";
const char kTestStringPropertyServerKey[] = "test-string-property-server"; const char kTestStringPropertyServerKey[] = "test-string-property-server";
...@@ -77,7 +78,7 @@ void TestPrimitiveProperty(PropertyConverter* property_converter, ...@@ -77,7 +78,7 @@ void TestPrimitiveProperty(PropertyConverter* property_converter,
const char* transport_name, const char* transport_name,
T value_1, T value_1,
T value_2) { T value_2) {
property_converter->RegisterProperty( property_converter->RegisterPrimitiveProperty(
key, transport_name, PropertyConverter::CreateAcceptAnyValueCallback()); key, transport_name, PropertyConverter::CreateAcceptAnyValueCallback());
EXPECT_EQ(transport_name, EXPECT_EQ(transport_name,
property_converter->GetTransportNameForPropertyKey(key)); property_converter->GetTransportNameForPropertyKey(key));
...@@ -174,8 +175,8 @@ TEST_F(PropertyConverterTest, TestPrimitiveVerifier) { ...@@ -174,8 +175,8 @@ TEST_F(PropertyConverterTest, TestPrimitiveVerifier) {
std::unique_ptr<Window> window(CreateNormalWindow(1, root_window(), nullptr)); std::unique_ptr<Window> window(CreateNormalWindow(1, root_window(), nullptr));
PropertyConverter property_converter; PropertyConverter property_converter;
property_converter.RegisterProperty(kTestPropertyKey8, property_converter.RegisterPrimitiveProperty(
kTestPropertyServerKey8, kTestPropertyKey8, kTestPropertyServerKey8,
base::Bind(&OnlyAllowNegativeNumbers)); base::Bind(&OnlyAllowNegativeNumbers));
// Test that we reject invalid TransportValues during // Test that we reject invalid TransportValues during
...@@ -197,29 +198,29 @@ TEST_F(PropertyConverterTest, TestPrimitiveVerifier) { ...@@ -197,29 +198,29 @@ TEST_F(PropertyConverterTest, TestPrimitiveVerifier) {
// Verifies property setting behavior for a gfx::ImageSkia* property. // Verifies property setting behavior for a gfx::ImageSkia* property.
TEST_F(PropertyConverterTest, ImageSkiaProperty) { TEST_F(PropertyConverterTest, ImageSkiaProperty) {
PropertyConverter property_converter; PropertyConverter property_converter;
property_converter.RegisterProperty(kTestImagePropertyKey, property_converter.RegisterImageSkiaProperty(kTestImageSkiaPropertyKey,
kTestImagePropertyServerKey); kTestImageSkiaPropertyServerKey);
EXPECT_EQ( EXPECT_EQ(kTestImageSkiaPropertyServerKey,
kTestImagePropertyServerKey, property_converter.GetTransportNameForPropertyKey(
property_converter.GetTransportNameForPropertyKey(kTestImagePropertyKey)); kTestImageSkiaPropertyKey));
EXPECT_TRUE(property_converter.IsTransportNameRegistered( EXPECT_TRUE(property_converter.IsTransportNameRegistered(
kTestImagePropertyServerKey)); kTestImageSkiaPropertyServerKey));
SkBitmap bitmap_1; SkBitmap bitmap_1;
bitmap_1.allocN32Pixels(16, 32); bitmap_1.allocN32Pixels(16, 32);
bitmap_1.eraseARGB(255, 11, 22, 33); bitmap_1.eraseARGB(255, 11, 22, 33);
gfx::ImageSkia value_1 = gfx::ImageSkia::CreateFrom1xBitmap(bitmap_1); gfx::ImageSkia value_1 = gfx::ImageSkia::CreateFrom1xBitmap(bitmap_1);
std::unique_ptr<Window> window(CreateNormalWindow(1, root_window(), nullptr)); std::unique_ptr<Window> window(CreateNormalWindow(1, root_window(), nullptr));
window->SetProperty(kTestImagePropertyKey, new gfx::ImageSkia(value_1)); window->SetProperty(kTestImageSkiaPropertyKey, new gfx::ImageSkia(value_1));
gfx::ImageSkia* image_out_1 = window->GetProperty(kTestImagePropertyKey); gfx::ImageSkia* image_out_1 = window->GetProperty(kTestImageSkiaPropertyKey);
EXPECT_TRUE(gfx::BitmapsAreEqual(bitmap_1, *image_out_1->bitmap())); EXPECT_TRUE(gfx::BitmapsAreEqual(bitmap_1, *image_out_1->bitmap()));
std::string transport_name_out; std::string transport_name_out;
std::unique_ptr<std::vector<uint8_t>> transport_value_out; std::unique_ptr<std::vector<uint8_t>> transport_value_out;
EXPECT_TRUE(property_converter.ConvertPropertyForTransport( EXPECT_TRUE(property_converter.ConvertPropertyForTransport(
window.get(), kTestImagePropertyKey, &transport_name_out, window.get(), kTestImageSkiaPropertyKey, &transport_name_out,
&transport_value_out)); &transport_value_out));
EXPECT_EQ(kTestImagePropertyServerKey, transport_name_out); EXPECT_EQ(kTestImageSkiaPropertyServerKey, transport_name_out);
EXPECT_EQ(mojo::ConvertTo<std::vector<uint8_t>>(bitmap_1), EXPECT_EQ(mojo::ConvertTo<std::vector<uint8_t>>(bitmap_1),
*transport_value_out.get()); *transport_value_out.get());
...@@ -231,15 +232,15 @@ TEST_F(PropertyConverterTest, ImageSkiaProperty) { ...@@ -231,15 +232,15 @@ TEST_F(PropertyConverterTest, ImageSkiaProperty) {
std::vector<uint8_t> transport_value = std::vector<uint8_t> transport_value =
mojo::ConvertTo<std::vector<uint8_t>>(bitmap_2); mojo::ConvertTo<std::vector<uint8_t>>(bitmap_2);
property_converter.SetPropertyFromTransportValue( property_converter.SetPropertyFromTransportValue(
window.get(), kTestImagePropertyServerKey, &transport_value); window.get(), kTestImageSkiaPropertyServerKey, &transport_value);
gfx::ImageSkia* image_out_2 = window->GetProperty(kTestImagePropertyKey); gfx::ImageSkia* image_out_2 = window->GetProperty(kTestImageSkiaPropertyKey);
EXPECT_TRUE(gfx::BitmapsAreEqual(bitmap_2, *image_out_2->bitmap())); EXPECT_TRUE(gfx::BitmapsAreEqual(bitmap_2, *image_out_2->bitmap()));
} }
// Verifies property setting behavior for a gfx::Rect* property. // Verifies property setting behavior for a gfx::Rect* property.
TEST_F(PropertyConverterTest, RectProperty) { TEST_F(PropertyConverterTest, RectProperty) {
PropertyConverter property_converter; PropertyConverter property_converter;
property_converter.RegisterProperty(kTestRectPropertyKey, property_converter.RegisterRectProperty(kTestRectPropertyKey,
kTestRectPropertyServerKey); kTestRectPropertyServerKey);
EXPECT_EQ( EXPECT_EQ(
kTestRectPropertyServerKey, kTestRectPropertyServerKey,
...@@ -272,7 +273,7 @@ TEST_F(PropertyConverterTest, RectProperty) { ...@@ -272,7 +273,7 @@ TEST_F(PropertyConverterTest, RectProperty) {
// Verifies property setting behavior for a gfx::Size* property. // Verifies property setting behavior for a gfx::Size* property.
TEST_F(PropertyConverterTest, SizeProperty) { TEST_F(PropertyConverterTest, SizeProperty) {
PropertyConverter property_converter; PropertyConverter property_converter;
property_converter.RegisterProperty(kTestSizePropertyKey, property_converter.RegisterSizeProperty(kTestSizePropertyKey,
kTestSizePropertyServerKey); kTestSizePropertyServerKey);
EXPECT_EQ( EXPECT_EQ(
kTestSizePropertyServerKey, kTestSizePropertyServerKey,
...@@ -305,7 +306,7 @@ TEST_F(PropertyConverterTest, SizeProperty) { ...@@ -305,7 +306,7 @@ TEST_F(PropertyConverterTest, SizeProperty) {
// Verifies property setting behavior for a std::string* property. // Verifies property setting behavior for a std::string* property.
TEST_F(PropertyConverterTest, StringProperty) { TEST_F(PropertyConverterTest, StringProperty) {
PropertyConverter property_converter; PropertyConverter property_converter;
property_converter.RegisterProperty(kTestStringPropertyKey, property_converter.RegisterStringProperty(kTestStringPropertyKey,
kTestStringPropertyServerKey); kTestStringPropertyServerKey);
EXPECT_EQ(kTestStringPropertyServerKey, EXPECT_EQ(kTestStringPropertyServerKey,
property_converter.GetTransportNameForPropertyKey( property_converter.GetTransportNameForPropertyKey(
...@@ -338,7 +339,7 @@ TEST_F(PropertyConverterTest, StringProperty) { ...@@ -338,7 +339,7 @@ TEST_F(PropertyConverterTest, StringProperty) {
// Verifies property setting behavior for a base::string16* property. // Verifies property setting behavior for a base::string16* property.
TEST_F(PropertyConverterTest, String16Property) { TEST_F(PropertyConverterTest, String16Property) {
PropertyConverter property_converter; PropertyConverter property_converter;
property_converter.RegisterProperty(kTestString16PropertyKey, property_converter.RegisterString16Property(kTestString16PropertyKey,
kTestString16PropertyServerKey); kTestString16PropertyServerKey);
EXPECT_EQ(kTestString16PropertyServerKey, EXPECT_EQ(kTestString16PropertyServerKey,
property_converter.GetTransportNameForPropertyKey( property_converter.GetTransportNameForPropertyKey(
......
...@@ -82,13 +82,13 @@ bool IsWindowHostVisible(Window* window) { ...@@ -82,13 +82,13 @@ bool IsWindowHostVisible(Window* window) {
// Register some test window properties for aura/mus conversion. // Register some test window properties for aura/mus conversion.
void RegisterTestProperties(PropertyConverter* converter) { void RegisterTestProperties(PropertyConverter* converter) {
converter->RegisterProperty( converter->RegisterPrimitiveProperty(
kTestPropertyKey1, kTestPropertyServerKey1, kTestPropertyKey1, kTestPropertyServerKey1,
PropertyConverter::CreateAcceptAnyValueCallback()); PropertyConverter::CreateAcceptAnyValueCallback());
converter->RegisterProperty( converter->RegisterPrimitiveProperty(
kTestPropertyKey2, kTestPropertyServerKey2, kTestPropertyKey2, kTestPropertyServerKey2,
PropertyConverter::CreateAcceptAnyValueCallback()); PropertyConverter::CreateAcceptAnyValueCallback());
converter->RegisterProperty( converter->RegisterPrimitiveProperty(
kTestPropertyKey3, kTestPropertyServerKey3, kTestPropertyKey3, kTestPropertyServerKey3,
PropertyConverter::CreateAcceptAnyValueCallback()); PropertyConverter::CreateAcceptAnyValueCallback());
} }
......
...@@ -94,7 +94,7 @@ MusClient::MusClient(service_manager::Connector* connector, ...@@ -94,7 +94,7 @@ MusClient::MusClient(service_manager::Connector* connector,
// TODO(msw): Avoid this... use some default value? Allow clients to extend? // TODO(msw): Avoid this... use some default value? Allow clients to extend?
property_converter_ = base::MakeUnique<aura::PropertyConverter>(); property_converter_ = base::MakeUnique<aura::PropertyConverter>();
property_converter_->RegisterProperty( property_converter_->RegisterPrimitiveProperty(
wm::kShadowElevationKey, wm::kShadowElevationKey,
ui::mojom::WindowManager::kShadowElevation_Property, ui::mojom::WindowManager::kShadowElevation_Property,
base::Bind(&wm::IsValidShadowElevation)); base::Bind(&wm::IsValidShadowElevation));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment