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> |
| 9 |
8 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
9 #include "ash/common/shelf/shelf_item_types.h" | 11 #include "ash/common/shelf/shelf_item_types.h" |
10 | 12 |
11 namespace ash { | 13 namespace ash { |
12 class Shelf; | 14 |
| 15 class WmShelf; |
13 | 16 |
14 // Delegate shared by all shelf instances. | 17 // Delegate shared by all shelf instances. |
15 class ASH_EXPORT ShelfDelegate { | 18 class ASH_EXPORT ShelfDelegate { |
16 public: | 19 public: |
17 virtual ~ShelfDelegate() {} | 20 virtual ~ShelfDelegate() {} |
18 | 21 |
19 // Callback used to allow delegate to perform initialization actions that | 22 // Callback used to allow delegate to perform initialization actions that |
20 // depend on the Shelf being in a known state. | 23 // depend on the Shelf being in a known state. |
21 virtual void OnShelfCreated(Shelf* shelf) = 0; | 24 virtual void OnShelfCreated(WmShelf* shelf) = 0; |
22 | 25 |
23 // Callback used to inform the delegate that a specific shelf no longer | 26 // Callback used to inform the delegate that a specific shelf no longer |
24 // exists. | 27 // exists. |
25 virtual void OnShelfDestroyed(Shelf* shelf) = 0; | 28 virtual void OnShelfDestroyed(WmShelf* shelf) = 0; |
26 | 29 |
27 // Called when |shelf|'s alignment changes. | 30 // Called when |shelf|'s alignment changes. |
28 virtual void OnShelfAlignmentChanged(Shelf* shelf) = 0; | 31 virtual void OnShelfAlignmentChanged(WmShelf* shelf) = 0; |
29 | 32 |
30 // Called when |shelf|'s auto-hide behavior changes. | 33 // Called when |shelf|'s auto-hide behavior changes. |
31 virtual void OnShelfAutoHideBehaviorChanged(Shelf* shelf) = 0; | 34 virtual void OnShelfAutoHideBehaviorChanged(WmShelf* shelf) = 0; |
32 | 35 |
33 // Called when |shelf|'s auto-hide state changes. | 36 // Called when |shelf|'s auto-hide state changes. |
34 virtual void OnShelfAutoHideStateChanged(Shelf* shelf) = 0; | 37 virtual void OnShelfAutoHideStateChanged(WmShelf* shelf) = 0; |
35 | 38 |
36 // Called when |shelf|'s visibility state is committed. | 39 // Called when |shelf|'s visibility state is committed. |
37 virtual void OnShelfVisibilityStateChanged(Shelf* shelf) = 0; | 40 virtual void OnShelfVisibilityStateChanged(WmShelf* shelf) = 0; |
38 | 41 |
39 // Get the shelf ID from an application ID. | 42 // Get the shelf ID from an application ID. |
40 virtual ShelfID GetShelfIDForAppID(const std::string& app_id) = 0; | 43 virtual ShelfID GetShelfIDForAppID(const std::string& app_id) = 0; |
41 | 44 |
42 // Checks whether a mapping exists from the ShelfID |id| to an app id. | 45 // Checks whether a mapping exists from the ShelfID |id| to an app id. |
43 virtual bool HasShelfIDToAppIDMapping(ShelfID id) const = 0; | 46 virtual bool HasShelfIDToAppIDMapping(ShelfID id) const = 0; |
44 | 47 |
45 // Get the application ID for a given shelf ID. | 48 // Get the application ID for a given shelf ID. |
46 // |HasShelfIDToAppIDMapping(ShelfID)| should be called first to ensure the | 49 // |HasShelfIDToAppIDMapping(ShelfID)| should be called first to ensure the |
47 // ShelfID can be successfully mapped to an app id. | 50 // ShelfID can be successfully mapped to an app id. |
48 virtual const std::string& GetAppIDForShelfID(ShelfID id) = 0; | 51 virtual const std::string& GetAppIDForShelfID(ShelfID id) = 0; |
49 | 52 |
50 // Pins an app with |app_id| to shelf. A running instance will get pinned. | 53 // Pins an app with |app_id| to shelf. A running instance will get pinned. |
51 // In case there is no running instance a new shelf item is created and | 54 // In case there is no running instance a new shelf item is created and |
52 // pinned. | 55 // pinned. |
53 virtual void PinAppWithID(const std::string& app_id) = 0; | 56 virtual void PinAppWithID(const std::string& app_id) = 0; |
54 | 57 |
55 // Check if the app with |app_id_| is pinned to the shelf. | 58 // Check if the app with |app_id_| is pinned to the shelf. |
56 virtual bool IsAppPinned(const std::string& app_id) = 0; | 59 virtual bool IsAppPinned(const std::string& app_id) = 0; |
57 | 60 |
58 // Unpins app item with |app_id|. | 61 // Unpins app item with |app_id|. |
59 virtual void UnpinAppWithID(const std::string& app_id) = 0; | 62 virtual void UnpinAppWithID(const std::string& app_id) = 0; |
60 }; | 63 }; |
61 | 64 |
62 } // namespace ash | 65 } // namespace ash |
63 | 66 |
64 #endif // ASH_COMMON_SHELF_SHELF_DELEGATE_H_ | 67 #endif // ASH_COMMON_SHELF_SHELF_DELEGATE_H_ |
OLD | NEW |