| 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_SHELF_SHELF_DELEGATE_H_ | 5 #ifndef ASH_SHELF_SHELF_DELEGATE_H_ |
| 6 #define ASH_SHELF_SHELF_DELEGATE_H_ | 6 #define ASH_SHELF_SHELF_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "ash/launcher/launcher_types.h" | 9 #include "ash/launcher/launcher_types.h" |
| 10 | 10 |
| 11 namespace ash { | 11 namespace ash { |
| 12 class Launcher; | 12 class Shelf; |
| 13 | 13 |
| 14 // Delegate for the Launcher. | 14 // Delegate for the Shelf. |
| 15 class ASH_EXPORT ShelfDelegate { | 15 class ASH_EXPORT ShelfDelegate { |
| 16 public: | 16 public: |
| 17 // Launcher owns the delegate. | 17 // Shelf owns the delegate. |
| 18 virtual ~ShelfDelegate() {} | 18 virtual ~ShelfDelegate() {} |
| 19 | 19 |
| 20 // Callback used to allow delegate to perform initialization actions that | 20 // Callback used to allow delegate to perform initialization actions that |
| 21 // depend on the Launcher being in a known state. | 21 // depend on the Shelf being in a known state. |
| 22 virtual void OnLauncherCreated(Launcher* launcher) = 0; | 22 virtual void OnShelfCreated(Shelf* shelf) = 0; |
| 23 | 23 |
| 24 // Callback used to inform the delegate that a specific launcher no longer | 24 // Callback used to inform the delegate that a specific shelf no longer |
| 25 // exists. | 25 // exists. |
| 26 virtual void OnLauncherDestroyed(Launcher* launcher) = 0; | 26 virtual void OnShelfDestroyed(Shelf* shelf) = 0; |
| 27 | 27 |
| 28 // Get the launcher ID from an application ID. | 28 // Get the shelf ID from an application ID. |
| 29 virtual LauncherID GetLauncherIDForAppID(const std::string& app_id) = 0; | 29 virtual LauncherID GetLauncherIDForAppID(const std::string& app_id) = 0; |
| 30 | 30 |
| 31 // Get the application ID for a given launcher ID. | 31 // Get the application ID for a given launcher ID. |
| 32 virtual const std::string& GetAppIDForLauncherID(LauncherID id) = 0; | 32 virtual const std::string& GetAppIDForLauncherID(LauncherID id) = 0; |
| 33 | 33 |
| 34 // Pins an app with |app_id| to launcher. A running instance will get pinned. | 34 // Pins an app with |app_id| to shelf. A running instance will get pinned. |
| 35 // In case there is no running instance a new launcher item is created and | 35 // In case there is no running instance a new shelf item is created and |
| 36 // pinned. | 36 // pinned. |
| 37 virtual void PinAppWithID(const std::string& app_id) = 0; | 37 virtual void PinAppWithID(const std::string& app_id) = 0; |
| 38 | 38 |
| 39 // Check if the app with |app_id_| is pinned to the launcher. | 39 // Check if the app with |app_id_| is pinned to the shelf. |
| 40 virtual bool IsAppPinned(const std::string& app_id) = 0; | 40 virtual bool IsAppPinned(const std::string& app_id) = 0; |
| 41 | 41 |
| 42 // Checks whether the user is allowed to pin/unpin apps. Pinning may be | 42 // Checks whether the user is allowed to pin/unpin apps. Pinning may be |
| 43 // disallowed by policy in case there is a pre-defined set of pinned apps. | 43 // disallowed by policy in case there is a pre-defined set of pinned apps. |
| 44 virtual bool CanPin() const = 0; | 44 virtual bool CanPin() const = 0; |
| 45 | 45 |
| 46 // Unpins app item with |app_id|. | 46 // Unpins app item with |app_id|. |
| 47 virtual void UnpinAppWithID(const std::string& app_id) = 0; | 47 virtual void UnpinAppWithID(const std::string& app_id) = 0; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 } // namespace ash | 50 } // namespace ash |
| 51 | 51 |
| 52 #endif // ASH_SHELF_SHELF_DELEGATE_H_ | 52 #endif // ASH_SHELF_SHELF_DELEGATE_H_ |
| OLD | NEW |