| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_LAUNCHER_LAUNCHER_DELEGATE_H_ | 5 #ifndef ASH_LAUNCHER_LAUNCHER_DELEGATE_H_ |
| 6 #define ASH_LAUNCHER_LAUNCHER_DELEGATE_H_ | 6 #define ASH_LAUNCHER_LAUNCHER_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 aura { | 11 namespace aura { |
| 12 class Window; | 12 class Window; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace ash { | 15 namespace ash { |
| 16 class Launcher; | 16 class Launcher; |
| 17 | 17 |
| 18 // Delegate for the Launcher. | 18 // Delegate for the Launcher. |
| 19 class ASH_EXPORT LauncherDelegate { | 19 class ASH_EXPORT LauncherDelegate { |
| 20 public: | 20 public: |
| 21 // Launcher owns the delegate. | 21 // Launcher owns the delegate. |
| 22 virtual ~LauncherDelegate() {} | 22 virtual ~LauncherDelegate() {} |
| 23 | 23 |
| 24 // Returns the id of the item associated with the specified window, or 0 if | 24 // Returns the id of the item associated with the specified window, or 0 if |
| 25 // there isn't one. | 25 // there isn't one. |
| 26 // Note: Windows of tabbed browsers will return the |LauncherID| of the | 26 // Note: Windows of tabbed browsers will return the |LauncherID| of the |
| 27 // currently active tab or selected tab. | 27 // currently active tab or selected tab. |
| 28 // TODO(simon.hong81): Remove this and handle in LauncherItemDelegateManager. |
| 28 virtual LauncherID GetIDByWindow(aura::Window* window) = 0; | 29 virtual LauncherID GetIDByWindow(aura::Window* window) = 0; |
| 29 | 30 |
| 30 // Callback used to allow delegate to perform initialization actions that | 31 // Callback used to allow delegate to perform initialization actions that |
| 31 // depend on the Launcher being in a known state. | 32 // depend on the Launcher being in a known state. |
| 32 virtual void OnLauncherCreated(Launcher* launcher) = 0; | 33 virtual void OnLauncherCreated(Launcher* launcher) = 0; |
| 33 | 34 |
| 34 // Callback used to inform the delegate that a specific launcher no longer | 35 // Callback used to inform the delegate that a specific launcher no longer |
| 35 // exists. | 36 // exists. |
| 36 virtual void OnLauncherDestroyed(Launcher* launcher) = 0; | 37 virtual void OnLauncherDestroyed(Launcher* launcher) = 0; |
| 37 | 38 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 53 // disallowed by policy in case there is a pre-defined set of pinned apps. | 54 // disallowed by policy in case there is a pre-defined set of pinned apps. |
| 54 virtual bool CanPin() const = 0; | 55 virtual bool CanPin() const = 0; |
| 55 | 56 |
| 56 // Unpins app item with |app_id|. | 57 // Unpins app item with |app_id|. |
| 57 virtual void UnpinAppWithID(const std::string& app_id) = 0; | 58 virtual void UnpinAppWithID(const std::string& app_id) = 0; |
| 58 }; | 59 }; |
| 59 | 60 |
| 60 } // namespace ash | 61 } // namespace ash |
| 61 | 62 |
| 62 #endif // ASH_LAUNCHER_LAUNCHER_DELEGATE_H_ | 63 #endif // ASH_LAUNCHER_LAUNCHER_DELEGATE_H_ |
| OLD | NEW |