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

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

Issue 2865743002: ash: Rename AppLaunchId to ShelfID. (Closed)
Patch Set: Address comment. 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/public/cpp/app_launch_id.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 c32f9db6b1d45461462db210013781645d312db6..a198dfa94601c8962f0120268bbd662ac8a9efea 100644
--- a/ash/public/cpp/shelf_types.h
+++ b/ash/public/cpp/shelf_types.h
@@ -6,8 +6,8 @@
#define ASH_PUBLIC_CPP_SHELF_TYPES_H_
#include <cstdint>
+#include <string>
-#include "ash/public/cpp/app_launch_id.h"
#include "ash/public/cpp/ash_public_export.h"
namespace ash {
@@ -90,9 +90,6 @@ enum ShelfAction {
SHELF_ACTION_APP_LIST_SHOWN,
};
-// TODO(msw): Rename AppLaunchId to ShelfID.
-using ShelfID = AppLaunchId;
-
// The type of a shelf item.
enum ShelfItemType {
// Represents a running app panel.
@@ -135,6 +132,33 @@ enum ShelfItemStatus {
STATUS_ATTENTION,
};
+// A unique shelf item id composed of an |app_id| and a |launch_id|.
+// |app_id| is the non-empty application id associated with a set of windows.
+// |launch_id| is passed on app launch, to support multiple shelf items per app.
+// 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());
+ ~ShelfID();
+
+ ShelfID(const ShelfID& other);
+ ShelfID(ShelfID&& other);
+ ShelfID& operator=(const ShelfID& other);
+ bool operator==(const ShelfID& other) const;
+ bool operator!=(const ShelfID& other) const;
+ bool operator<(const ShelfID& other) const;
+
+ // Returns true if both the application id and launch id are empty.
+ // This is often used to determine if the id is invalid.
+ bool IsNull() const;
+
+ // 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.
+ std::string launch_id;
+};
+
} // namespace ash
#endif // ASH_PUBLIC_CPP_SHELF_TYPES_H_
« no previous file with comments | « ash/public/cpp/app_launch_id.cc ('k') | ash/public/cpp/shelf_types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698