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

Unified Diff: ash/public/cpp/shelf_types.h

Issue 2878133002: mash: Serialize ShelfIDs for property conversion and transport. (Closed)
Patch Set: Address comments. 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
« no previous file with comments | « ash/mus_property_mirror_ash_unittest.cc ('k') | ash/public/cpp/shelf_types.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/public/cpp/shelf_types.h
diff --git a/ash/public/cpp/shelf_types.h b/ash/public/cpp/shelf_types.h
index a198dfa94601c8962f0120268bbd662ac8a9efea..1ccd5099e2ca4a46946099d4a7eabde8f384df17 100644
--- a/ash/public/cpp/shelf_types.h
+++ b/ash/public/cpp/shelf_types.h
@@ -138,8 +138,8 @@ enum ShelfItemStatus {
// As an example, a remote desktop client may want each remote application to
// have its own icon.
struct ASH_PUBLIC_EXPORT ShelfID {
- ShelfID(const std::string& app_id = std::string(),
- const std::string& launch_id = std::string());
+ explicit ShelfID(const std::string& app_id = std::string(),
+ const std::string& launch_id = std::string());
~ShelfID();
ShelfID(const ShelfID& other);
@@ -153,6 +153,12 @@ struct ASH_PUBLIC_EXPORT ShelfID {
// This is often used to determine if the id is invalid.
bool IsNull() const;
+ // Functions to [de]serialize ids as a string for window property usage, etc.
+ // Serialization appends ids with a delimeter that must not be used in ids.
+ // Deserialization returns an empty/null/default id for a null string input.
+ std::string Serialize() const;
+ static ShelfID Deserialize(const std::string* string);
+
// The application id associated with a set of windows.
std::string app_id;
// An id passed on app launch, to support multiple shelf items per app.
« no previous file with comments | « ash/mus_property_mirror_ash_unittest.cc ('k') | ash/public/cpp/shelf_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698