| 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" |
| 11 #include "ash/common/shelf/shelf_item_types.h" | 11 #include "ash/common/shelf/shelf_item_types.h" |
| 12 | 12 |
| 13 namespace ash { | 13 namespace ash { |
| 14 | 14 |
| 15 class WmShelf; | 15 class WmShelf; |
| 16 | 16 |
| 17 // Delegate shared by all shelf instances. | 17 // Delegate shared by all shelf instances. |
| 18 class ASH_EXPORT ShelfDelegate { | 18 class ASH_EXPORT ShelfDelegate { |
| 19 public: | 19 public: |
| 20 virtual ~ShelfDelegate() {} | 20 virtual ~ShelfDelegate() {} |
| 21 | 21 |
| 22 // Callback used to allow delegate to perform initialization actions that | |
| 23 // depend on the Shelf being in a known state. | |
| 24 virtual void OnShelfCreated(WmShelf* shelf) = 0; | |
| 25 | |
| 26 // Callback used to inform the delegate that a specific shelf no longer | |
| 27 // exists. | |
| 28 virtual void OnShelfDestroyed(WmShelf* shelf) = 0; | |
| 29 | |
| 30 // Called when |shelf|'s alignment changes. | |
| 31 virtual void OnShelfAlignmentChanged(WmShelf* shelf) = 0; | |
| 32 | |
| 33 // Called when |shelf|'s auto-hide behavior changes. | |
| 34 virtual void OnShelfAutoHideBehaviorChanged(WmShelf* shelf) = 0; | |
| 35 | |
| 36 // Called when |shelf|'s auto-hide state changes. | |
| 37 virtual void OnShelfAutoHideStateChanged(WmShelf* shelf) = 0; | |
| 38 | |
| 39 // Called when |shelf|'s visibility state is committed. | |
| 40 virtual void OnShelfVisibilityStateChanged(WmShelf* shelf) = 0; | |
| 41 | |
| 42 // Get the shelf ID from an application ID. | 22 // Get the shelf ID from an application ID. |
| 43 virtual ShelfID GetShelfIDForAppID(const std::string& app_id) = 0; | 23 virtual ShelfID GetShelfIDForAppID(const std::string& app_id) = 0; |
| 44 | 24 |
| 45 // Get the shelf ID from an application ID and a launch ID. | 25 // 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 | 26 // 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 | 27 // 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. | 28 // uniquely identify each shelf item that has the same app_id. |
| 49 // For example, a single virtualization app might want to show different | 29 // For example, a single virtualization app might want to show different |
| 50 // shelf icons for different remote apps. | 30 // shelf icons for different remote apps. |
| 51 virtual ShelfID GetShelfIDForAppIDAndLaunchID( | 31 virtual ShelfID GetShelfIDForAppIDAndLaunchID( |
| (...skipping 16 matching lines...) Expand all Loading... |
| 68 // Check if the app with |app_id_| is pinned to the shelf. | 48 // Check if the app with |app_id_| is pinned to the shelf. |
| 69 virtual bool IsAppPinned(const std::string& app_id) = 0; | 49 virtual bool IsAppPinned(const std::string& app_id) = 0; |
| 70 | 50 |
| 71 // Unpins app item with |app_id|. | 51 // Unpins app item with |app_id|. |
| 72 virtual void UnpinAppWithID(const std::string& app_id) = 0; | 52 virtual void UnpinAppWithID(const std::string& app_id) = 0; |
| 73 }; | 53 }; |
| 74 | 54 |
| 75 } // namespace ash | 55 } // namespace ash |
| 76 | 56 |
| 77 #endif // ASH_COMMON_SHELF_SHELF_DELEGATE_H_ | 57 #endif // ASH_COMMON_SHELF_SHELF_DELEGATE_H_ |
| OLD | NEW |