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

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

Issue 2445163002: Make aura work with mus (Closed)
Patch Set: NON_EXPORTED_BASE_CLASS Created 4 years, 2 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
« no previous file with comments | « ui/aura/mus/mus_types.h ('k') | ui/aura/mus/surface_id_handler.h » ('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
new file mode 100644
index 0000000000000000000000000000000000000000..dc0656562586eed2ede8af0660f699ccbe786787
--- /dev/null
+++ b/ui/aura/mus/property_converter.h
@@ -0,0 +1,52 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_AURA_MUS_PROPERTY_CONVERTER_H_
+#define UI_AURA_MUS_PROPERTY_CONVERTER_H_
+
+#include <stdint.h>
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "ui/aura/aura_export.h"
+
+namespace aura {
+
+class Window;
+
+// PropertyConverter is used to convert Window properties for transport to the
+// mus window server and back. Any time a property changes from one side it is
+// mapped to the other using this class. Not all Window properties need to map
+// to server properties, and similarly not all transport properties need map to
+// Window properties.
+class PropertyConverter {
+ public:
+ virtual ~PropertyConverter() {}
+
+ // Maps a property on the Window to a property pushed to the server. Return
+ // true if the property should be sent to the server, false if the property
+ // is only used locally.
+ virtual bool ConvertPropertyForTransport(
+ Window* window,
+ const void* key,
+ std::string* transport_name,
+ std::unique_ptr<std::vector<uint8_t>>* transport_value) = 0;
+
+ // Returns the transport name for a Window property.
+ virtual std::string GetTransportNameForPropertyKey(const void* key) = 0;
+
+ // Applies a value from the server to |window|. |transport_name| is the
+ // name of the property and |transport_data| the value. |transport_data| may
+ // be null.
+ virtual void SetPropertyFromTransportValue(
+ Window* window,
+ const std::string& transport_name,
+ const std::vector<uint8_t>* transport_data) = 0;
+};
+
+} // namespace aura
+
+#endif // UI_AURA_MUS_PROPERTY_CONVERTER_H_
« no previous file with comments | « ui/aura/mus/mus_types.h ('k') | ui/aura/mus/surface_id_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698