| 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_SEARCH_RESULT_LIST_VIEW_DELEGATE_H_ | 5 #ifndef UI_APP_LIST_VIEWS_SEARCH_RESULT_LIST_VIEW_DELEGATE_H_ |
| 6 #define UI_APP_LIST_VIEWS_SEARCH_RESULT_LIST_VIEW_DELEGATE_H_ | 6 #define UI_APP_LIST_VIEWS_SEARCH_RESULT_LIST_VIEW_DELEGATE_H_ |
| 7 | 7 |
| 8 #include "ui/app_list/app_list_export.h" | 8 #include "ui/app_list/app_list_export.h" |
| 9 | 9 |
| 10 namespace app_list { | 10 namespace app_list { |
| 11 | 11 |
| 12 class SearchResult; | 12 class SearchResult; |
| 13 | 13 |
| 14 class APP_LIST_EXPORT SearchResultListViewDelegate { | 14 class APP_LIST_EXPORT SearchResultListViewDelegate { |
| 15 public: | 15 public: |
| 16 // Invoked to open given |result|. |event_flags| contains the flags of the | 16 // Invoked to open given |result|. |event_flags| contains the flags of the |
| 17 // keyboard/mouse event that triggers the "open" request. Delegate could use | 17 // keyboard/mouse event that triggers the "open" request. |auto_launch| is |
| 18 // the |event_flags| information to choose different ways to open the result. | 18 // true when the result is opened automatically through voice-search. Delegate |
| 19 // could use the |event_flags| information to choose different ways to open |
| 20 // the result. |
| 19 virtual void OpenResult(SearchResult* result, | 21 virtual void OpenResult(SearchResult* result, |
| 22 bool auto_launch, |
| 20 int event_flags) = 0; | 23 int event_flags) = 0; |
| 21 | 24 |
| 22 // Called to invoke a custom action on |result|. |action_index| corresponds | 25 // Called to invoke a custom action on |result|. |action_index| corresponds |
| 23 // to the index of the icon in |result.action_icons()| that was activated. | 26 // to the index of the icon in |result.action_icons()| that was activated. |
| 24 virtual void InvokeResultAction(SearchResult* result, | 27 virtual void InvokeResultAction(SearchResult* result, |
| 25 int action_index, | 28 int action_index, |
| 26 int event_flags) = 0; | 29 int event_flags) = 0; |
| 27 | 30 |
| 28 // Called when the app represented by |result| is installed. | 31 // Called when the app represented by |result| is installed. |
| 29 virtual void OnResultInstalled(SearchResult* result) = 0; | 32 virtual void OnResultInstalled(SearchResult* result) = 0; |
| 30 | 33 |
| 31 // Called when the app represented by |result| is uninstalled. | 34 // Called when the app represented by |result| is uninstalled. |
| 32 virtual void OnResultUninstalled(SearchResult* result) = 0; | 35 virtual void OnResultUninstalled(SearchResult* result) = 0; |
| 33 | 36 |
| 34 protected: | 37 protected: |
| 35 virtual ~SearchResultListViewDelegate() {} | 38 virtual ~SearchResultListViewDelegate() {} |
| 36 }; | 39 }; |
| 37 | 40 |
| 38 } // namespace app_list | 41 } // namespace app_list |
| 39 | 42 |
| 40 #endif // UI_APP_LIST_VIEWS_SEARCH_RESULT_LIST_VIEW_DELEGATE_H_ | 43 #endif // UI_APP_LIST_VIEWS_SEARCH_RESULT_LIST_VIEW_DELEGATE_H_ |
| OLD | NEW |