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

Side by Side Diff: ui/aura/mus/property_converter.h

Issue 2445163002: Make aura work with mus (Closed)
Patch Set: NON_EXPORTED_BASE_CLASS 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_AURA_MUS_PROPERTY_CONVERTER_H_
6 #define UI_AURA_MUS_PROPERTY_CONVERTER_H_
7
8 #include <stdint.h>
9
10 #include <memory>
11 #include <string>
12 #include <vector>
13
14 #include "ui/aura/aura_export.h"
15
16 namespace aura {
17
18 class Window;
19
20 // PropertyConverter is used to convert Window properties for transport to the
21 // mus window server and back. Any time a property changes from one side it is
22 // mapped to the other using this class. Not all Window properties need to map
23 // to server properties, and similarly not all transport properties need map to
24 // Window properties.
25 class PropertyConverter {
26 public:
27 virtual ~PropertyConverter() {}
28
29 // Maps a property on the Window to a property pushed to the server. Return
30 // true if the property should be sent to the server, false if the property
31 // is only used locally.
32 virtual bool ConvertPropertyForTransport(
33 Window* window,
34 const void* key,
35 std::string* transport_name,
36 std::unique_ptr<std::vector<uint8_t>>* transport_value) = 0;
37
38 // Returns the transport name for a Window property.
39 virtual std::string GetTransportNameForPropertyKey(const void* key) = 0;
40
41 // Applies a value from the server to |window|. |transport_name| is the
42 // name of the property and |transport_data| the value. |transport_data| may
43 // be null.
44 virtual void SetPropertyFromTransportValue(
45 Window* window,
46 const std::string& transport_name,
47 const std::vector<uint8_t>* transport_data) = 0;
48 };
49
50 } // namespace aura
51
52 #endif // UI_AURA_MUS_PROPERTY_CONVERTER_H_
OLDNEW
« 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