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_COMMON_SHELF_SHELF_ITEM_DELEGATE_H_ | 5 #ifndef ASH_COMMON_SHELF_SHELF_ITEM_DELEGATE_H_ |
6 #define ASH_COMMON_SHELF_SHELF_ITEM_DELEGATE_H_ | 6 #define ASH_COMMON_SHELF_SHELF_ITEM_DELEGATE_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 // Invoked when the user clicks on a window entry in the launcher. | 38 // Invoked when the user clicks on a window entry in the launcher. |
39 // |event| is the click event. The |event| is dispatched by a view | 39 // |event| is the click event. The |event| is dispatched by a view |
40 // and has an instance of |views::View| as the event target | 40 // and has an instance of |views::View| as the event target |
41 // but not |aura::Window|. If the |event| is of type KeyEvent, it is assumed | 41 // but not |aura::Window|. If the |event| is of type KeyEvent, it is assumed |
42 // that this was triggered by keyboard action (Alt+<number>) and special | 42 // that this was triggered by keyboard action (Alt+<number>) and special |
43 // handling might happen. | 43 // handling might happen. |
44 // Returns the action performed by selecting the item. | 44 // Returns the action performed by selecting the item. |
45 virtual PerformedAction ItemSelected(const ui::Event& event) = 0; | 45 virtual PerformedAction ItemSelected(const ui::Event& event) = 0; |
46 | 46 |
47 // Returns the title to display. | |
48 virtual base::string16 GetTitle() = 0; | |
49 | |
50 // Returns the application menu model for the specified item. There are three | 47 // Returns the application menu model for the specified item. There are three |
51 // possible return values: | 48 // possible return values: |
52 // - A return of NULL indicates that no menu is wanted for this item. | 49 // - A return of NULL indicates that no menu is wanted for this item. |
53 // - A return of a menu with one item means that only the name of the | 50 // - A return of a menu with one item means that only the name of the |
54 // application/item was added and there are no active applications. | 51 // application/item was added and there are no active applications. |
55 // Note: This is useful for hover menus which also show context help. | 52 // Note: This is useful for hover menus which also show context help. |
56 // - A list containing the title and the active list of items. | 53 // - A list containing the title and the active list of items. |
57 // The caller takes ownership of the returned model. | 54 // The caller takes ownership of the returned model. |
58 // |event_flags| specifies the flags of the event which triggered this menu. | 55 // |event_flags| specifies the flags of the event which triggered this menu. |
59 virtual ShelfMenuModel* CreateApplicationMenu(int event_flags) = 0; | 56 virtual ShelfMenuModel* CreateApplicationMenu(int event_flags) = 0; |
60 | 57 |
61 // Closes all windows associated with this item. | 58 // Closes all windows associated with this item. |
62 virtual void Close() = 0; | 59 virtual void Close() = 0; |
63 }; | 60 }; |
64 | 61 |
65 } // namespace ash | 62 } // namespace ash |
66 | 63 |
67 #endif // ASH_COMMON_SHELF_SHELF_ITEM_DELEGATE_H_ | 64 #endif // ASH_COMMON_SHELF_SHELF_ITEM_DELEGATE_H_ |
OLD | NEW |