| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_SEARCH_RESULT_LIST_VIEW_H_ | 5 #ifndef UI_APP_LIST_SEARCH_RESULT_LIST_VIEW_H_ |
| 6 #define UI_APP_LIST_SEARCH_RESULT_LIST_VIEW_H_ | 6 #define UI_APP_LIST_SEARCH_RESULT_LIST_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "ui/app_list/app_list_model.h" | 10 #include "ui/app_list/app_list_model.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 // Updates UI with model. | 42 // Updates UI with model. |
| 43 void Update(); | 43 void Update(); |
| 44 | 44 |
| 45 // Schedules an Update call using |update_factory_|. Do nothing if there is a | 45 // Schedules an Update call using |update_factory_|. Do nothing if there is a |
| 46 // pending call. | 46 // pending call. |
| 47 void ScheduleUpdate(); | 47 void ScheduleUpdate(); |
| 48 | 48 |
| 49 // Overridden from ListModelObserver: | 49 // Overridden from ListModelObserver: |
| 50 virtual void ListItemsAdded(size_t start, size_t count) OVERRIDE; | 50 virtual void ListItemsAdded(size_t start, size_t count) OVERRIDE; |
| 51 virtual void ListItemsRemoved(size_t start, size_t count) OVERRIDE; | 51 virtual void ListItemsRemoved(size_t start, size_t count) OVERRIDE; |
| 52 virtual void ListItemMoved(size_t index, size_t target_index) OVERRIDE; |
| 52 virtual void ListItemsChanged(size_t start, size_t count) OVERRIDE; | 53 virtual void ListItemsChanged(size_t start, size_t count) OVERRIDE; |
| 53 | 54 |
| 54 // Overridden from SearchResultViewDelegate: | 55 // Overridden from SearchResultViewDelegate: |
| 55 virtual void SearchResultActivated(SearchResultView* view, | 56 virtual void SearchResultActivated(SearchResultView* view, |
| 56 const ui::Event& event) OVERRIDE; | 57 const ui::Event& event) OVERRIDE; |
| 57 virtual void SearchResultActionActivated(SearchResultView* view, | 58 virtual void SearchResultActionActivated(SearchResultView* view, |
| 58 int action_index, | 59 int action_index, |
| 59 const ui::Event& event) OVERRIDE; | 60 const ui::Event& event) OVERRIDE; |
| 60 | 61 |
| 61 SearchResultListViewDelegate* delegate_; // Not owned. | 62 SearchResultListViewDelegate* delegate_; // Not owned. |
| 62 AppListModel::SearchResults* results_; // Owned by AppListModel. | 63 AppListModel::SearchResults* results_; // Owned by AppListModel. |
| 63 | 64 |
| 64 int last_visible_index_; | 65 int last_visible_index_; |
| 65 int selected_index_; | 66 int selected_index_; |
| 66 | 67 |
| 67 // The factory that consolidates multiple Update calls into one. | 68 // The factory that consolidates multiple Update calls into one. |
| 68 base::WeakPtrFactory<SearchResultListView> update_factory_; | 69 base::WeakPtrFactory<SearchResultListView> update_factory_; |
| 69 | 70 |
| 70 DISALLOW_COPY_AND_ASSIGN(SearchResultListView); | 71 DISALLOW_COPY_AND_ASSIGN(SearchResultListView); |
| 71 }; | 72 }; |
| 72 | 73 |
| 73 } // namespace app_ist | 74 } // namespace app_ist |
| 74 | 75 |
| 75 #endif // UI_APP_LIST_SEARCH_RESULT_LIST_VIEW_H_ | 76 #endif // UI_APP_LIST_SEARCH_RESULT_LIST_VIEW_H_ |
| OLD | NEW |