| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
| 10 #include "ash/launcher/launcher_types.h" |
| 10 #include "base/string16.h" | 11 #include "base/string16.h" |
| 11 | 12 |
| 12 namespace ui { | 13 namespace ui { |
| 13 class MenuModel; | 14 class MenuModel; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace ash { | 17 namespace ash { |
| 17 | 18 |
| 18 struct LauncherItem; | |
| 19 | |
| 20 // Delegate for the Launcher. | 19 // Delegate for the Launcher. |
| 21 class ASH_EXPORT LauncherDelegate { | 20 class ASH_EXPORT LauncherDelegate { |
| 22 public: | 21 public: |
| 23 virtual ~LauncherDelegate() {} | 22 virtual ~LauncherDelegate() {} |
| 24 | 23 |
| 25 // Invoked when the user clicks on button in the launcher to create a new | 24 // Invoked when the user clicks on button in the launcher to create a new |
| 26 // window. | 25 // window. |
| 27 virtual void CreateNewWindow() = 0; | 26 virtual void CreateNewWindow() = 0; |
| 28 | 27 |
| 29 // Invoked when the user clicks on a window entry in the launcher. | 28 // Invoked when the user clicks on a window entry in the launcher. |
| 30 virtual void ItemClicked(const LauncherItem& item) = 0; | 29 virtual void ItemClicked(const LauncherItem& item) = 0; |
| 31 | 30 |
| 32 // Returns the resource id of the image to show on the browser shortcut | 31 // Returns the resource id of the image to show on the browser shortcut |
| 33 // button. | 32 // button. |
| 34 virtual int GetBrowserShortcutResourceId() = 0; | 33 virtual int GetBrowserShortcutResourceId() = 0; |
| 35 | 34 |
| 36 // Returns the title to display for the specified launcher item. | 35 // Returns the title to display for the specified launcher item. |
| 37 virtual string16 GetTitle(const LauncherItem& item) = 0; | 36 virtual string16 GetTitle(const LauncherItem& item) = 0; |
| 38 | 37 |
| 39 // Returns the context menumodel for the specified item. Return NULL if there | 38 // Returns the context menumodel for the specified item. Return NULL if there |
| 40 // should be no context menu. The caller takes ownership of the returned | 39 // should be no context menu. The caller takes ownership of the returned |
| 41 // model. | 40 // model. |
| 42 virtual ui::MenuModel* CreateContextMenu(const LauncherItem& item) = 0; | 41 virtual ui::MenuModel* CreateContextMenu(const LauncherItem& item) = 0; |
| 42 |
| 43 // Returns the id of the item associated with the specified window, or 0 if |
| 44 // there isn't one. |
| 45 virtual ash::LauncherID GetIDByWindow(aura::Window* window) = 0; |
| 43 }; | 46 }; |
| 44 | 47 |
| 45 } // namespace ash | 48 } // namespace ash |
| 46 | 49 |
| 47 #endif // ASH_LAUNCHER_LAUNCHER_DELEGATE_H_ | 50 #endif // ASH_LAUNCHER_LAUNCHER_DELEGATE_H_ |
| OLD | NEW |