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
3 // found in the LICENSE file.
5 #ifndef UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_
6 #define UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_
8 #include "ui/app_list/app_list_export.h"
12 class AppListItemModel
;
16 class APP_LIST_EXPORT AppListViewDelegate
{
18 // AppListView owns the delegate.
19 virtual ~AppListViewDelegate() {}
21 // Invoked to set the model that AppListView uses.
22 // Note that AppListView owns the model.
23 virtual void SetModel(AppListModel
* model
) = 0;
25 // Invoked when an AppListeItemModelView is activated by click or enter key.
26 virtual void ActivateAppListItem(AppListItemModel
* item
,
29 // Invoked to start a new search. Delegate collects query input from
30 // SearchBoxModel and populates SearchResults. Both models are sub models
32 virtual void StartSearch() = 0;
34 // Invoked to stop the current search.
35 virtual void StopSearch() = 0;
37 // Invoked to open the search result.
38 virtual void OpenSearchResult(const SearchResult
& result
,
41 // Called to invoke a custom action on |result|. |action_index| corresponds
42 // to the index of an icon in |result.action_icons()|.
43 virtual void InvokeSearchResultAction(const SearchResult
& result
,
47 // Invoked to close app list.
48 virtual void Close() = 0;
51 } // namespace app_list
53 #endif // UI_APP_LIST_APP_LIST_VIEW_DELEGATE_H_