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