Index: ui/app_list/app_list_view.h |
diff --git a/ui/app_list/app_list_view.h b/ui/app_list/app_list_view.h |
index 76d2599ece87db1fd9d162baf99a7ae224514060..8428f16c23813304576aee5e46b8b01b4608decf 100644 |
--- a/ui/app_list/app_list_view.h |
+++ b/ui/app_list/app_list_view.h |
@@ -6,6 +6,8 @@ |
#define UI_APP_LIST_APP_LIST_VIEW_H_ |
#include "base/memory/scoped_ptr.h" |
+#include "base/memory/scoped_vector.h" |
+#include "base/timer.h" |
#include "ui/app_list/app_list_export.h" |
#include "ui/app_list/apps_grid_view_delegate.h" |
#include "ui/app_list/search_box_view_delegate.h" |
@@ -48,13 +50,27 @@ class APP_LIST_EXPORT AppListView : public views::BubbleDelegateView, |
void SetAnchorPoint(const gfx::Point& anchor_point); |
+ // Shows the UI when there are no pending icon loads. Otherwise, starts a |
+ // timer to show the UI when a maximum allowed wait time has expired. |
+ void ShowWhenReady(); |
+ |
void Close(); |
void UpdateBounds(); |
private: |
- // Creates models to use. |
- void CreateModel(); |
+ class IconLoader; |
+ |
+ // Loads icon image for the apps in the selected page of |pagination_model|. |
+ // |anchor| is used to determine the image scale factor to use. |
+ void PreloadIcons(PaginationModel* pagination_model, |
+ views::View* anchor); |
+ |
+ // Invoked when |icon_loading_wait_timer_| fires. |
+ void OnIconLoadingWaitTimer(); |
+ |
+ // Invoked from an IconLoader when icon loading is finished. |
+ void OnItemIconLoaded(IconLoader* loader); |
// Overridden from views::WidgetDelegateView: |
virtual views::View* GetInitiallyFocusedView() OVERRIDE; |
@@ -88,6 +104,12 @@ class APP_LIST_EXPORT AppListView : public views::BubbleDelegateView, |
SearchBoxView* search_box_view_; // Owned by views hierarchy. |
ContentsView* contents_view_; // Owned by views hierarchy. |
+ // A timer that fires when maximum allowed time to wait for icon loading has |
+ // passed. |
+ base::OneShotTimer<AppListView> icon_loading_wait_timer_; |
+ |
+ ScopedVector<IconLoader> pending_icon_loaders_; |
+ |
DISALLOW_COPY_AND_ASSIGN(AppListView); |
}; |