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_SHELF_SHELF_DELEGATE_H_ | |
6 #define ASH_SHELF_SHELF_DELEGATE_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "ash/ash_export.h" | |
11 #include "ash/public/cpp/shelf_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. Returns kInvalidShelfID if the | |
21 // app id is unknown, or has no associated ShelfID. | |
22 virtual ShelfID GetShelfIDForAppID(const std::string& app_id) = 0; | |
23 | |
24 // Get the shelf ID from an application ID and a launch ID. | |
25 // The launch ID can be passed to an app when launched in order to support | |
26 // multiple shelf items per app. This id is used together with the app_id to | |
27 // uniquely identify each shelf item that has the same app_id. | |
28 // For example, a single virtualization app might want to show different | |
29 // shelf icons for different remote apps. Returns kInvalidShelfID if the app | |
30 // id is unknown or has no associated ShelfID. | |
31 virtual ShelfID GetShelfIDForAppIDAndLaunchID( | |
32 const std::string& app_id, | |
33 const std::string& launch_id) = 0; | |
34 | |
35 // Get the application ID for a given shelf ID. Returns an empty string for | |
36 // an unknown or invalid ShelfID. | |
37 virtual const std::string& GetAppIDForShelfID(ShelfID id) = 0; | |
38 | |
39 // Pins an app with |app_id| to shelf. A running instance will get pinned. | |
40 // In case there is no running instance a new shelf item is created and | |
41 // pinned. | |
42 virtual void PinAppWithID(const std::string& app_id) = 0; | |
43 | |
44 // Check if the app with |app_id_| is pinned to the shelf. | |
45 virtual bool IsAppPinned(const std::string& app_id) = 0; | |
46 | |
47 // Unpins app item with |app_id|. | |
48 virtual void UnpinAppWithID(const std::string& app_id) = 0; | |
49 }; | |
50 | |
51 } // namespace ash | |
52 | |
53 #endif // ASH_SHELF_SHELF_DELEGATE_H_ | |
OLD | NEW |