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

Unified Diff: ash/public/cpp/window_properties.cc

Issue 2915223002: mash: Fix mash app shelf items; encapsulate ash property setup. (Closed)
Patch Set: Similar changes for other mash apps. Created 3 years, 7 months 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
Index: ash/public/cpp/window_properties.cc
diff --git a/ash/public/cpp/window_properties.cc b/ash/public/cpp/window_properties.cc
index 5b5d42f9b636b91bf75679f6ea73a744d133a71f..a5c3fb4d4603540c228710eff21967d5a1a00c19 100644
--- a/ash/public/cpp/window_properties.cc
+++ b/ash/public/cpp/window_properties.cc
@@ -4,8 +4,13 @@
#include "ash/public/cpp/window_properties.h"
+#include "ash/public/cpp/mus_property_mirror_ash.h"
#include "ash/public/cpp/shelf_types.h"
+#include "ash/public/cpp/window_pin_type.h"
#include "ash/public/interfaces/window_pin_type.mojom.h"
+#include "services/ui/public/interfaces/window_manager.mojom.h"
+#include "ui/aura/mus/property_converter.h"
+#include "ui/views/mus/mus_client.h"
DECLARE_EXPORTED_UI_CLASS_PROPERTY_TYPE(ASH_PUBLIC_EXPORT,
ash::mojom::WindowPinType)
@@ -19,4 +24,25 @@ DEFINE_UI_CLASS_PROPERTY_KEY(mojom::WindowPinType,
kWindowPinTypeKey,
mojom::WindowPinType::NONE);
+void RegisterWindowPropertiesForTransportAndMirroring() {
+ DCHECK(views::MusClient::Exists());
+ views::MusClient* mus_client = views::MusClient::Get();
+ aura::WindowTreeClientDelegate* delegate = mus_client;
+ aura::PropertyConverter* converter = delegate->GetPropertyConverter();
+
+ converter->RegisterPrimitiveProperty(
+ kPanelAttachedKey, ui::mojom::WindowManager::kPanelAttached_Property,
+ aura::PropertyConverter::CreateAcceptAnyValueCallback());
+ converter->RegisterPrimitiveProperty(
+ kShelfItemTypeKey, ui::mojom::WindowManager::kShelfItemType_Property,
+ base::Bind(&IsValidShelfItemType));
+ converter->RegisterPrimitiveProperty(kWindowPinTypeKey,
+ mojom::kWindowPinType_Property,
+ base::Bind(&IsValidWindowPinType));
+ converter->RegisterStringProperty(
+ kShelfIDKey, ui::mojom::WindowManager::kShelfID_Property);
+
+ mus_client->SetMusPropertyMirror(base::MakeUnique<MusPropertyMirrorAsh>());
+}
+
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698