OLD | NEW |
| (Empty) |
1 // Copyright 2013 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 ASH_COMMON_SHELF_SHELF_DELEGATE_H_ | |
6 #define ASH_COMMON_SHELF_SHELF_DELEGATE_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "ash/ash_export.h" | |
11 #include "ash/common/shelf/shelf_item_types.h" | |
12 | |
13 namespace ash { | |
14 | |
15 // Delegate shared by all shelf instances. | |
16 class ASH_EXPORT ShelfDelegate { | |
17 public: | |
18 virtual ~ShelfDelegate() {} | |
19 | |
20 // Get the shelf ID from an application ID. | |
21 virtual ShelfID GetShelfIDForAppID(const std::string& app_id) = 0; | |
22 | |
23 // Get the shelf ID from an application ID and a launch ID. | |
24 // The launch ID can be passed to an app when launched in order to support | |
25 // multiple shelf items per app. This id is used together with the app_id to | |
26 // uniquely identify each shelf item that has the same app_id. | |
27 // For example, a single virtualization app might want to show different | |
28 // shelf icons for different remote apps. | |
29 virtual ShelfID GetShelfIDForAppIDAndLaunchID( | |
30 const std::string& app_id, | |
31 const std::string& launch_id) = 0; | |
32 | |
33 // Checks whether a mapping exists from the ShelfID |id| to an app id. | |
34 virtual bool HasShelfIDToAppIDMapping(ShelfID id) const = 0; | |
35 | |
36 // Get the application ID for a given shelf ID. | |
37 // |HasShelfIDToAppIDMapping(ShelfID)| should be called first to ensure the | |
38 // ShelfID can be successfully mapped to an app id. | |
39 virtual const std::string& GetAppIDForShelfID(ShelfID id) = 0; | |
40 | |
41 // Pins an app with |app_id| to shelf. A running instance will get pinned. | |
42 // In case there is no running instance a new shelf item is created and | |
43 // pinned. | |
44 virtual void PinAppWithID(const std::string& app_id) = 0; | |
45 | |
46 // Check if the app with |app_id_| is pinned to the shelf. | |
47 virtual bool IsAppPinned(const std::string& app_id) = 0; | |
48 | |
49 // Unpins app item with |app_id|. | |
50 virtual void UnpinAppWithID(const std::string& app_id) = 0; | |
51 }; | |
52 | |
53 } // namespace ash | |
54 | |
55 #endif // ASH_COMMON_SHELF_SHELF_DELEGATE_H_ | |
OLD | NEW |