OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 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. | |
4 | |
5 #ifndef UI_APP_LIST_VIEWS_SEARCH_RESULT_ANSWER_CARD_VIEW_H_ | |
6 #define UI_APP_LIST_VIEWS_SEARCH_RESULT_ANSWER_CARD_VIEW_H_ | |
7 | |
8 #include "ui/app_list/app_list_model_observer.h" | |
9 #include "ui/app_list/views/search_result_container_view.h" | |
10 | |
11 namespace app_list { | |
12 | |
13 class AppListModel; | |
14 class SearchResultPageView; | |
15 | |
16 namespace { | |
17 class SearchAnswerContainerView; | |
18 } // namespace | |
xiyuan
2017/05/25 16:42:53
nit: "// namespace" is not needed for forward decl
vadimt
2017/05/25 20:15:16
Done.
| |
19 | |
20 // Result container for the search answer card. | |
21 class APP_LIST_EXPORT SearchResultAnswerCardView | |
xiyuan
2017/05/25 16:42:53
nit: The name is a bit confusing. It is the contai
vadimt
2017/05/25 20:15:16
There are 2 sibling classes:
SearchResultListView
xiyuan
2017/05/25 20:52:04
The name of the two siblings are clear to see that
vadimt
2017/05/25 22:59:04
Cool; here I'm leaving my version; thanks!
| |
22 : public SearchResultContainerView, | |
23 public AppListModelObserver { | |
24 public: | |
25 SearchResultAnswerCardView(AppListModel* model, | |
26 SearchResultPageView* search_results_page_view, | |
27 views::View* search_answer_view); | |
28 ~SearchResultAnswerCardView() override; | |
29 | |
30 // Overridden from SearchResultContainerView: | |
31 void OnContainerSelected(bool from_bottom, | |
32 bool directional_movement) override; | |
33 void NotifyFirstResultYIndex(int y_index) override {} | |
34 int GetYSize() override; | |
35 | |
36 // Overridden from views::View: | |
37 const char* GetClassName() const override; | |
38 | |
39 private: | |
40 // Overridden from SearchResultContainerView: | |
xiyuan
2017/05/25 16:42:53
nit: Can we group overriddens from the same interf
vadimt
2017/05/25 20:15:16
Done.
| |
41 int DoUpdate() override; | |
42 void UpdateSelectedIndex(int old_selected, int new_selected) override; | |
43 | |
44 // Overridden from AppListModelObserver | |
45 void OnSearchAnswerAvailableChanged(bool has_answer) override; | |
46 | |
47 // Unowned pointer to application list model. | |
48 AppListModel* const model_; | |
49 // Pointer to the container of the search answer; owned by the view hierarchy. | |
xiyuan
2017/05/25 16:42:53
nit: insert an empty line before
vadimt
2017/05/25 20:15:16
Done.
| |
50 // It's visible iff we have a search answer result. | |
51 SearchAnswerContainerView* const search_answer_container_view_; | |
52 | |
53 DISALLOW_COPY_AND_ASSIGN(SearchResultAnswerCardView); | |
54 }; | |
55 | |
56 } // namespace app_list | |
57 | |
58 #endif // UI_APP_LIST_VIEWS_SEARCH_RESULT_ANSWER_CARD_VIEW_H_ | |
OLD | NEW |