OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_COMMON_SHELF_SHELF_DELEGATE_H_ | 5 #ifndef ASH_COMMON_SHELF_SHELF_DELEGATE_H_ |
6 #define ASH_COMMON_SHELF_SHELF_DELEGATE_H_ | 6 #define ASH_COMMON_SHELF_SHELF_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
(...skipping 24 matching lines...) Expand all Loading... | |
35 | 35 |
36 // Called when |shelf|'s auto-hide state changes. | 36 // Called when |shelf|'s auto-hide state changes. |
37 virtual void OnShelfAutoHideStateChanged(WmShelf* shelf) = 0; | 37 virtual void OnShelfAutoHideStateChanged(WmShelf* shelf) = 0; |
38 | 38 |
39 // Called when |shelf|'s visibility state is committed. | 39 // Called when |shelf|'s visibility state is committed. |
40 virtual void OnShelfVisibilityStateChanged(WmShelf* shelf) = 0; | 40 virtual void OnShelfVisibilityStateChanged(WmShelf* shelf) = 0; |
41 | 41 |
42 // Get the shelf ID from an application ID. | 42 // Get the shelf ID from an application ID. |
43 virtual ShelfID GetShelfIDForAppID(const std::string& app_id) = 0; | 43 virtual ShelfID GetShelfIDForAppID(const std::string& app_id) = 0; |
44 | 44 |
45 // Get the shelf ID from an application ID and a launch ID. | |
46 // The launch ID can be passed to an app when launched in order to support | |
47 // multiple shelf items per app. This id is used together with the app_id to | |
48 // uniquely identify each shelf item that has the same app_id. | |
James Cook
2016/09/01 16:15:18
nit: I would also say something like: "For example
Andra Paraschiv
2016/09/02 07:35:44
Done.
| |
49 virtual ShelfID GetShelfIDForAppIDAndLaunchID( | |
50 const std::string& app_id, | |
51 const std::string& launch_id) = 0; | |
52 | |
45 // Checks whether a mapping exists from the ShelfID |id| to an app id. | 53 // Checks whether a mapping exists from the ShelfID |id| to an app id. |
46 virtual bool HasShelfIDToAppIDMapping(ShelfID id) const = 0; | 54 virtual bool HasShelfIDToAppIDMapping(ShelfID id) const = 0; |
47 | 55 |
48 // Get the application ID for a given shelf ID. | 56 // Get the application ID for a given shelf ID. |
49 // |HasShelfIDToAppIDMapping(ShelfID)| should be called first to ensure the | 57 // |HasShelfIDToAppIDMapping(ShelfID)| should be called first to ensure the |
50 // ShelfID can be successfully mapped to an app id. | 58 // ShelfID can be successfully mapped to an app id. |
51 virtual const std::string& GetAppIDForShelfID(ShelfID id) = 0; | 59 virtual const std::string& GetAppIDForShelfID(ShelfID id) = 0; |
52 | 60 |
53 // Pins an app with |app_id| to shelf. A running instance will get pinned. | 61 // Pins an app with |app_id| to shelf. A running instance will get pinned. |
54 // In case there is no running instance a new shelf item is created and | 62 // In case there is no running instance a new shelf item is created and |
55 // pinned. | 63 // pinned. |
56 virtual void PinAppWithID(const std::string& app_id) = 0; | 64 virtual void PinAppWithID(const std::string& app_id) = 0; |
57 | 65 |
58 // Check if the app with |app_id_| is pinned to the shelf. | 66 // Check if the app with |app_id_| is pinned to the shelf. |
59 virtual bool IsAppPinned(const std::string& app_id) = 0; | 67 virtual bool IsAppPinned(const std::string& app_id) = 0; |
60 | 68 |
61 // Unpins app item with |app_id|. | 69 // Unpins app item with |app_id|. |
62 virtual void UnpinAppWithID(const std::string& app_id) = 0; | 70 virtual void UnpinAppWithID(const std::string& app_id) = 0; |
63 }; | 71 }; |
64 | 72 |
65 } // namespace ash | 73 } // namespace ash |
66 | 74 |
67 #endif // ASH_COMMON_SHELF_SHELF_DELEGATE_H_ | 75 #endif // ASH_COMMON_SHELF_SHELF_DELEGATE_H_ |
OLD | NEW |