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