OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_APP_LIST_VIEWS_SEARCH_RESULT_CONTAINER_VIEW_H_ | 5 #ifndef UI_APP_LIST_VIEWS_SEARCH_RESULT_CONTAINER_VIEW_H_ |
6 #define UI_APP_LIST_VIEWS_SEARCH_RESULT_CONTAINER_VIEW_H_ | 6 #define UI_APP_LIST_VIEWS_SEARCH_RESULT_CONTAINER_VIEW_H_ |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "ui/app_list/app_list_model.h" | 9 #include "ui/app_list/app_list_model.h" |
10 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 int selected_index() const { return selected_index_; } | 36 int selected_index() const { return selected_index_; } |
37 | 37 |
38 // Returns whether |index| is a valid index for selection. | 38 // Returns whether |index| is a valid index for selection. |
39 bool IsValidSelectionIndex(int index) const; | 39 bool IsValidSelectionIndex(int index) const; |
40 | 40 |
41 int num_results() const { return num_results_; } | 41 int num_results() const { return num_results_; } |
42 | 42 |
43 void set_container_score(double score) { container_score_ = score; } | 43 void set_container_score(double score) { container_score_ = score; } |
44 double container_score() const { return container_score_; } | 44 double container_score() const { return container_score_; } |
45 | 45 |
| 46 // Updates the distance_from_origin() properties of the results in this |
| 47 // container. |y_index| is the absolute y-index of the first result of this |
| 48 // container (counting from the top of the app list). |
| 49 virtual void NotifyFirstResultYIndex(int y_index) = 0; |
| 50 |
| 51 // Gets the number of down keystrokes from the beginning to the end of this |
| 52 // container. |
| 53 virtual int GetYSize() = 0; |
| 54 |
46 // Schedules an Update call using |update_factory_|. Do nothing if there is a | 55 // Schedules an Update call using |update_factory_|. Do nothing if there is a |
47 // pending call. | 56 // pending call. |
48 void ScheduleUpdate(); | 57 void ScheduleUpdate(); |
49 | 58 |
| 59 // Returns whether an update is currently scheduled for this container. |
| 60 bool UpdateScheduled(); |
| 61 |
50 // Overridden from ui::ListModelObserver: | 62 // Overridden from ui::ListModelObserver: |
51 void ListItemsAdded(size_t start, size_t count) override; | 63 void ListItemsAdded(size_t start, size_t count) override; |
52 void ListItemsRemoved(size_t start, size_t count) override; | 64 void ListItemsRemoved(size_t start, size_t count) override; |
53 void ListItemMoved(size_t index, size_t target_index) override; | 65 void ListItemMoved(size_t index, size_t target_index) override; |
54 void ListItemsChanged(size_t start, size_t count) override; | 66 void ListItemsChanged(size_t start, size_t count) override; |
55 | 67 |
56 // Updates the container for being selected. |from_bottom| is true if the view | 68 // Updates the container for being selected. |from_bottom| is true if the view |
57 // was entered into from a selected view below it; false if entered into from | 69 // was entered into from a selected view below it; false if entered into from |
58 // above. |directional_movement| is true if the navigation was caused by | 70 // above. |directional_movement| is true if the navigation was caused by |
59 // directional controls (eg, arrow keys), as opposed to linear controls (eg, | 71 // directional controls (eg, arrow keys), as opposed to linear controls (eg, |
(...skipping 20 matching lines...) Expand all Loading... |
80 | 92 |
81 // The factory that consolidates multiple Update calls into one. | 93 // The factory that consolidates multiple Update calls into one. |
82 base::WeakPtrFactory<SearchResultContainerView> update_factory_; | 94 base::WeakPtrFactory<SearchResultContainerView> update_factory_; |
83 | 95 |
84 DISALLOW_COPY_AND_ASSIGN(SearchResultContainerView); | 96 DISALLOW_COPY_AND_ASSIGN(SearchResultContainerView); |
85 }; | 97 }; |
86 | 98 |
87 } // namespace app_list | 99 } // namespace app_list |
88 | 100 |
89 #endif // UI_APP_LIST_VIEWS_SEARCH_RESULT_CONTAINER_VIEW_H_ | 101 #endif // UI_APP_LIST_VIEWS_SEARCH_RESULT_CONTAINER_VIEW_H_ |
OLD | NEW |