OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 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_START_PAGE_VIEW_H_ | 5 #ifndef UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_ |
6 #define UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_ | 6 #define UI_APP_LIST_VIEWS_START_PAGE_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_export.h" | 10 #include "ui/app_list/app_list_export.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 void ShowSearchResults(); | 34 void ShowSearchResults(); |
35 | 35 |
36 bool IsShowingSearchResults() const; | 36 bool IsShowingSearchResults() const; |
37 | 37 |
38 void UpdateForTesting(); | 38 void UpdateForTesting(); |
39 | 39 |
40 const std::vector<TileItemView*>& tile_views() const { return tile_views_; } | 40 const std::vector<TileItemView*>& tile_views() const { return tile_views_; } |
41 SearchBoxView* dummy_search_box_view() { return search_box_view_; } | 41 SearchBoxView* dummy_search_box_view() { return search_box_view_; } |
42 | 42 |
43 // Overridden from views::View: | 43 // Overridden from views::View: |
44 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; | 44 virtual bool OnKeyPressed(const ui::KeyEvent& event) override; |
45 virtual void Layout() OVERRIDE; | 45 virtual void Layout() override; |
46 | 46 |
47 private: | 47 private: |
48 enum ShowState { | 48 enum ShowState { |
49 SHOW_START_PAGE, | 49 SHOW_START_PAGE, |
50 SHOW_SEARCH_RESULTS, | 50 SHOW_SEARCH_RESULTS, |
51 }; | 51 }; |
52 | 52 |
53 void InitInstantContainer(); | 53 void InitInstantContainer(); |
54 void InitTilesContainer(); | 54 void InitTilesContainer(); |
55 | 55 |
56 void SetShowState(ShowState show_state); | 56 void SetShowState(ShowState show_state); |
57 void SetModel(AppListModel* model); | 57 void SetModel(AppListModel* model); |
58 | 58 |
59 // Updates UI with model. | 59 // Updates UI with model. |
60 void Update(); | 60 void Update(); |
61 | 61 |
62 // Schedules an Update() call using |update_factory_|. Does nothing if there | 62 // Schedules an Update() call using |update_factory_|. Does nothing if there |
63 // is a pending call. | 63 // is a pending call. |
64 void ScheduleUpdate(); | 64 void ScheduleUpdate(); |
65 | 65 |
66 // Overridden from SearchBoxViewDelegate: | 66 // Overridden from SearchBoxViewDelegate: |
67 virtual void QueryChanged(SearchBoxView* sender) OVERRIDE; | 67 virtual void QueryChanged(SearchBoxView* sender) override; |
68 | 68 |
69 // Overridden from ui::ListModelObserver: | 69 // Overridden from ui::ListModelObserver: |
70 virtual void ListItemsAdded(size_t start, size_t count) OVERRIDE; | 70 virtual void ListItemsAdded(size_t start, size_t count) override; |
71 virtual void ListItemsRemoved(size_t start, size_t count) OVERRIDE; | 71 virtual void ListItemsRemoved(size_t start, size_t count) override; |
72 virtual void ListItemMoved(size_t index, size_t target_index) OVERRIDE; | 72 virtual void ListItemMoved(size_t index, size_t target_index) override; |
73 virtual void ListItemsChanged(size_t start, size_t count) OVERRIDE; | 73 virtual void ListItemsChanged(size_t start, size_t count) override; |
74 | 74 |
75 // The parent view of ContentsView which is the parent of this view. | 75 // The parent view of ContentsView which is the parent of this view. |
76 AppListMainView* app_list_main_view_; | 76 AppListMainView* app_list_main_view_; |
77 | 77 |
78 AppListModel::SearchResults* | 78 AppListModel::SearchResults* |
79 search_results_model_; // Owned by AppListSyncableService. | 79 search_results_model_; // Owned by AppListSyncableService. |
80 | 80 |
81 AppListViewDelegate* view_delegate_; // Owned by AppListView. | 81 AppListViewDelegate* view_delegate_; // Owned by AppListView. |
82 | 82 |
83 SearchBoxView* search_box_view_; // Owned by views hierarchy. | 83 SearchBoxView* search_box_view_; // Owned by views hierarchy. |
84 SearchResultListView* results_view_; // Owned by views hierarchy. | 84 SearchResultListView* results_view_; // Owned by views hierarchy. |
85 views::View* instant_container_; // Owned by views hierarchy. | 85 views::View* instant_container_; // Owned by views hierarchy. |
86 views::View* tiles_container_; // Owned by views hierarchy. | 86 views::View* tiles_container_; // Owned by views hierarchy. |
87 | 87 |
88 std::vector<TileItemView*> tile_views_; | 88 std::vector<TileItemView*> tile_views_; |
89 | 89 |
90 ShowState show_state_; | 90 ShowState show_state_; |
91 | 91 |
92 // ScheduleUpdate() generates a single weak pointer; if one exists then an | 92 // ScheduleUpdate() generates a single weak pointer; if one exists then an |
93 // update is pending. Further calls to ScheduleUpdate() will have no effect. | 93 // update is pending. Further calls to ScheduleUpdate() will have no effect. |
94 // Once the Update() completes, the weak pointer is invalidated. | 94 // Once the Update() completes, the weak pointer is invalidated. |
95 base::WeakPtrFactory<StartPageView> update_factory_; | 95 base::WeakPtrFactory<StartPageView> update_factory_; |
96 | 96 |
97 DISALLOW_COPY_AND_ASSIGN(StartPageView); | 97 DISALLOW_COPY_AND_ASSIGN(StartPageView); |
98 }; | 98 }; |
99 | 99 |
100 } // namespace app_list | 100 } // namespace app_list |
101 | 101 |
102 #endif // UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_ | 102 #endif // UI_APP_LIST_VIEWS_START_PAGE_VIEW_H_ |
OLD | NEW |