| 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 #include "base/string16.h" | 10 #include "base/string16.h" |
| 11 | 11 |
| 12 namespace aura { | 12 namespace aura { |
| 13 class RootWindow; | 13 class RootWindow; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace ui { | 16 namespace ui { |
| 17 class Event; |
| 17 class MenuModel; | 18 class MenuModel; |
| 18 } | 19 } |
| 19 | 20 |
| 20 namespace ash { | 21 namespace ash { |
| 21 | 22 |
| 22 // Delegate for the Launcher. | 23 // Delegate for the Launcher. |
| 23 class ASH_EXPORT LauncherDelegate { | 24 class ASH_EXPORT LauncherDelegate { |
| 24 public: | 25 public: |
| 25 // Launcher owns the delegate. | 26 // Launcher owns the delegate. |
| 26 virtual ~LauncherDelegate() {} | 27 virtual ~LauncherDelegate() {} |
| 27 | 28 |
| 28 // Invoked when the user clicks on button in the launcher to open last used | 29 // Invoked when the user clicks on button in the launcher to open last used |
| 29 // window (or create a new one if there is no last used window). | 30 // window (or create a new one if there is no last used window). |
| 30 // |event_flags| is the flags of the click event. | 31 // |event_flags| is the flags of the click event. |
| 31 virtual void OnBrowserShortcutClicked(int event_flags) = 0; | 32 virtual void OnBrowserShortcutClicked(int event_flags) = 0; |
| 32 | 33 |
| 33 // Invoked when the user clicks on a window entry in the launcher. | 34 // Invoked when the user clicks on a window entry in the launcher. |
| 34 // |event_flags| is the flags of the click event. | 35 // |event| is the click event. The |event| is dispatched by a view |
| 35 virtual void ItemClicked(const LauncherItem& item, int event_flags) = 0; | 36 // and has an instance of |views::View| as the event target |
| 37 // but not |aura::Window|. |
| 38 virtual void ItemClicked(const LauncherItem& item, |
| 39 const ui::Event& event) = 0; |
| 36 | 40 |
| 37 // Returns the resource id of the image to show on the browser shortcut | 41 // Returns the resource id of the image to show on the browser shortcut |
| 38 // button. | 42 // button. |
| 39 virtual int GetBrowserShortcutResourceId() = 0; | 43 virtual int GetBrowserShortcutResourceId() = 0; |
| 40 | 44 |
| 41 // Returns the title to display for the specified launcher item. | 45 // Returns the title to display for the specified launcher item. |
| 42 virtual string16 GetTitle(const LauncherItem& item) = 0; | 46 virtual string16 GetTitle(const LauncherItem& item) = 0; |
| 43 | 47 |
| 44 // Returns the context menumodel for the specified item on | 48 // Returns the context menumodel for the specified item on |
| 45 // |root_window|. Return NULL if there should be no context | 49 // |root_window|. Return NULL if there should be no context |
| (...skipping 15 matching lines...) Expand all Loading... |
| 61 // there isn't one. | 65 // there isn't one. |
| 62 virtual LauncherID GetIDByWindow(aura::Window* window) = 0; | 66 virtual LauncherID GetIDByWindow(aura::Window* window) = 0; |
| 63 | 67 |
| 64 // Whether the given launcher item is draggable. | 68 // Whether the given launcher item is draggable. |
| 65 virtual bool IsDraggable(const LauncherItem& item) = 0; | 69 virtual bool IsDraggable(const LauncherItem& item) = 0; |
| 66 }; | 70 }; |
| 67 | 71 |
| 68 } // namespace ash | 72 } // namespace ash |
| 69 | 73 |
| 70 #endif // ASH_LAUNCHER_LAUNCHER_DELEGATE_H_ | 74 #endif // ASH_LAUNCHER_LAUNCHER_DELEGATE_H_ |
| OLD | NEW |