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

Unified Diff: ash/shelf/shelf_model.h

Issue 2791463002: mash: Remove ShelfDelegate; move functions to ShelfModel. (Closed)
Patch Set: Sync and rebase; cleanup. Created 3 years, 8 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/shelf/shelf_model.h
diff --git a/ash/shelf/shelf_model.h b/ash/shelf/shelf_model.h
index b3bb09eb077cfb3298fbb2f0b3e09c9404103794..68bb326e2c788972be2c5daae88e19f96d42806f 100644
--- a/ash/shelf/shelf_model.h
+++ b/ash/shelf/shelf_model.h
@@ -9,6 +9,7 @@
#include <memory>
#include "ash/ash_export.h"
+#include "ash/public/cpp/app_launch_id.h"
#include "ash/public/cpp/shelf_item.h"
#include "ash/public/interfaces/shelf.mojom.h"
#include "base/macros.h"
@@ -25,6 +26,35 @@ class ASH_EXPORT ShelfModel {
ShelfModel();
~ShelfModel();
+ // Get the shelf ID from an application ID. Returns kInvalidShelfID if the
+ // app id is unknown, or has no associated ShelfID.
+ ShelfID GetShelfIDForAppID(const std::string& app_id);
+
+ // Get the shelf ID from an application ID and a launch ID.
+ // The launch ID can be passed to an app when launched in order to support
+ // multiple shelf items per app. This id is used together with the app_id to
+ // uniquely identify each shelf item that has the same app_id.
+ // For example, a single virtualization app might want to show different
+ // shelf icons for different remote apps. Returns kInvalidShelfID if the app
+ // id is unknown or has no associated ShelfID.
+ ShelfID GetShelfIDForAppIDAndLaunchID(const std::string& app_id,
+ const std::string& launch_id);
+
+ // Get the application ID for a given shelf ID. Returns an empty string for
+ // an unknown or invalid ShelfID.
+ const std::string& GetAppIDForShelfID(ShelfID id);
+
+ // Pins an app with |app_id| to shelf. A running instance will get pinned.
+ // In case there is no running instance a new shelf item is created and
+ // pinned.
+ void PinAppWithID(const std::string& app_id);
+
+ // Check if the app with |app_id_| is pinned to the shelf.
+ bool IsAppPinned(const std::string& app_id);
+
+ // Unpins app item with |app_id|.
+ void UnpinAppWithID(const std::string& app_id);
+
// Cleans up the ShelfItemDelegates.
void DestroyItemDelegates();
« no previous file with comments | « ash/shelf/shelf_delegate.h ('k') | ash/shelf/shelf_model.cc » ('j') | ash/shelf/shelf_model.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698