Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(437)

Unified Diff: ui/app_list/app_list_view.h

Issue 11418312: app_list: Improve initial icon loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, stop timer when showing widget because no pending icon loads Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/app_list/app_list_constants.cc ('k') | ui/app_list/app_list_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « ui/app_list/app_list_constants.cc ('k') | ui/app_list/app_list_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698