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 UI_APP_LIST_VIEWS_APPS_GRID_VIEW_DELEGATE_H_ | 5 #ifndef UI_APP_LIST_VIEWS_APPS_GRID_VIEW_DELEGATE_H_ |
6 #define UI_APP_LIST_VIEWS_APPS_GRID_VIEW_DELEGATE_H_ | 6 #define UI_APP_LIST_VIEWS_APPS_GRID_VIEW_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
11 #include "ui/app_list/app_list_export.h" | 11 #include "ui/app_list/app_list_export.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class FilePath; | 14 class FilePath; |
15 } | 15 } |
16 | 16 |
17 namespace app_list { | 17 namespace app_list { |
18 | 18 |
19 class AppListItem; | 19 class AppListItem; |
20 | 20 |
21 class APP_LIST_EXPORT AppsGridViewDelegate { | 21 class APP_LIST_EXPORT AppsGridViewDelegate { |
22 public: | 22 public: |
23 // Invoked when an item is activated on the grid view. |event_flags| contains | 23 // Invoked when an item is activated on the grid view. |event_flags| contains |
24 // the flags of the keyboard/mouse event that triggers the activation request. | 24 // the flags of the keyboard/mouse event that triggers the activation request. |
25 virtual void ActivateApp(AppListItem* item, int event_flags) = 0; | 25 virtual void ActivateApp(AppListItem* item, int event_flags) = 0; |
26 | 26 |
27 // Gets the path to a shortcut for the app represented by |item|. |callback| | |
28 // may be run immediately. | |
29 virtual void GetShortcutPathForApp( | |
30 const std::string& app_id, | |
31 const base::Callback<void(const base::FilePath&)>& callback) = 0; | |
32 | |
33 // Called by the root grid view to cancel a drag that started inside a folder. | 27 // Called by the root grid view to cancel a drag that started inside a folder. |
34 // This can occur when the root grid is visible for a reparent and its model | 28 // This can occur when the root grid is visible for a reparent and its model |
35 // changes, necessitating a cancel of the drag operation. | 29 // changes, necessitating a cancel of the drag operation. |
36 virtual void CancelDragInActiveFolder() = 0; | 30 virtual void CancelDragInActiveFolder() = 0; |
37 | 31 |
38 protected: | 32 protected: |
39 virtual ~AppsGridViewDelegate() {} | 33 virtual ~AppsGridViewDelegate() {} |
40 }; | 34 }; |
41 | 35 |
42 } // namespace app_list | 36 } // namespace app_list |
43 | 37 |
44 #endif // UI_APP_LIST_VIEWS_APPS_GRID_VIEW_DELEGATE_H_ | 38 #endif // UI_APP_LIST_VIEWS_APPS_GRID_VIEW_DELEGATE_H_ |
OLD | NEW |