| 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 } | |
| 19 | |
| 20 // Result container for the search answer card. | |
| 21 class APP_LIST_EXPORT SearchResultAnswerCardView | |
| 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 private: | |
| 31 // Overridden from views::View: | |
| 32 const char* GetClassName() const override; | |
| 33 | |
| 34 // Overridden from SearchResultContainerView: | |
| 35 void OnContainerSelected(bool from_bottom, | |
| 36 bool directional_movement) override; | |
| 37 void NotifyFirstResultYIndex(int y_index) override {} | |
| 38 int GetYSize() override; | |
| 39 int DoUpdate() override; | |
| 40 void UpdateSelectedIndex(int old_selected, int new_selected) override; | |
| 41 | |
| 42 // Overridden from AppListModelObserver | |
| 43 void OnSearchAnswerAvailableChanged(bool has_answer) override; | |
| 44 | |
| 45 // Unowned pointer to application list model. | |
| 46 AppListModel* const model_; | |
| 47 | |
| 48 // Pointer to the container of the search answer; owned by the view hierarchy. | |
| 49 // It's visible iff we have a search answer result. | |
| 50 SearchAnswerContainerView* const search_answer_container_view_; | |
| 51 | |
| 52 DISALLOW_COPY_AND_ASSIGN(SearchResultAnswerCardView); | |
| 53 }; | |
| 54 | |
| 55 } // namespace app_list | |
| 56 | |
| 57 #endif // UI_APP_LIST_VIEWS_SEARCH_RESULT_ANSWER_CARD_VIEW_H_ | |
| OLD | NEW |