WebKit roll 130275:130304
[chromium-blink-merge.git] / ui / app_list / app_list_view_delegate.h
blobd7e0c82f638e881b910223d7609aebba7054700f
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"
10 namespace app_list {
12 class AppListItemModel;
13 class AppListModel;
14 class SearchResult;
16 class APP_LIST_EXPORT AppListViewDelegate {
17 public:
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,
27 int event_flags) = 0;
29 // Invoked to start a new search. Delegate collects query input from
30 // SearchBoxModel and populates SearchResults. Both models are sub models
31 // of AppListModel.
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,
39 int event_flags) = 0;
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,
44 int action_index,
45 int event_flags) = 0;
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_