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 // Notifies the container of the y-index of the first result of this container | |
47 // relative to all other result containers. | |
48 virtual void NotifyFirstResultYIndex(int y_index) = 0; | |
Matt Giuca
2015/05/11 06:50:40
The documentation should say what this function *d
calamity
2015/05/11 07:15:03
Done.
| |
49 | |
50 // Gets the number of down keystrokes from the beginning to the end of this | |
51 // container. | |
52 virtual int GetYSize() = 0; | |
53 | |
46 // Schedules an Update call using |update_factory_|. Do nothing if there is a | 54 // Schedules an Update call using |update_factory_|. Do nothing if there is a |
47 // pending call. | 55 // pending call. |
48 void ScheduleUpdate(); | 56 void ScheduleUpdate(); |
49 | 57 |
58 // Returns whether an update is currently scheduled for this container. | |
59 bool UpdateScheduled(); | |
60 | |
50 // Overridden from ui::ListModelObserver: | 61 // Overridden from ui::ListModelObserver: |
51 void ListItemsAdded(size_t start, size_t count) override; | 62 void ListItemsAdded(size_t start, size_t count) override; |
52 void ListItemsRemoved(size_t start, size_t count) override; | 63 void ListItemsRemoved(size_t start, size_t count) override; |
53 void ListItemMoved(size_t index, size_t target_index) override; | 64 void ListItemMoved(size_t index, size_t target_index) override; |
54 void ListItemsChanged(size_t start, size_t count) override; | 65 void ListItemsChanged(size_t start, size_t count) override; |
55 | 66 |
56 // Updates the container for being selected. |from_bottom| is true if the view | 67 // 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 | 68 // 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 | 69 // above. |directional_movement| is true if the navigation was caused by |
59 // directional controls (eg, arrow keys), as opposed to linear controls (eg, | 70 // directional controls (eg, arrow keys), as opposed to linear controls (eg, |
(...skipping 20 matching lines...) Expand all Loading... | |
80 | 91 |
81 // The factory that consolidates multiple Update calls into one. | 92 // The factory that consolidates multiple Update calls into one. |
82 base::WeakPtrFactory<SearchResultContainerView> update_factory_; | 93 base::WeakPtrFactory<SearchResultContainerView> update_factory_; |
83 | 94 |
84 DISALLOW_COPY_AND_ASSIGN(SearchResultContainerView); | 95 DISALLOW_COPY_AND_ASSIGN(SearchResultContainerView); |
85 }; | 96 }; |
86 | 97 |
87 } // namespace app_list | 98 } // namespace app_list |
88 | 99 |
89 #endif // UI_APP_LIST_VIEWS_SEARCH_RESULT_CONTAINER_VIEW_H_ | 100 #endif // UI_APP_LIST_VIEWS_SEARCH_RESULT_CONTAINER_VIEW_H_ |
OLD | NEW |