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

Unified Diff: ui/app_list/cocoa/apps_grid_view_item.mm

Issue 19460003: One-click install for the OSX App Launcher Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Cleaner, more future-proof Created 6 years, 11 months 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
Index: ui/app_list/cocoa/apps_grid_view_item.mm
diff --git a/ui/app_list/cocoa/apps_grid_view_item.mm b/ui/app_list/cocoa/apps_grid_view_item.mm
index 92e5d1b77ea0fcb1f3aad2d7bcc53d4e0a33084d..dd6757977175d4da299ec5de6211069994c5fd2a 100644
--- a/ui/app_list/cocoa/apps_grid_view_item.mm
+++ b/ui/app_list/cocoa/apps_grid_view_item.mm
@@ -13,6 +13,7 @@
#include "ui/app_list/app_list_item.h"
#include "ui/app_list/app_list_item_observer.h"
#import "ui/app_list/cocoa/apps_grid_controller.h"
+#import "ui/app_list/cocoa/apps_pagination_model_observer.h"
#import "ui/base/cocoa/menu_controller.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/font.h"
@@ -53,7 +54,7 @@ const int kMacFontSizeDelta = -1;
// Ensure the page this item is on is the visible page in the grid.
- (void)ensureVisible;
-// Add or remove a progress bar from the view.
+// Adds a progress bar to the view if |isInstalling|, otherwise removes it.
- (void)setItemIsInstalling:(BOOL)isInstalling;
// Update the progress bar to represent |percent|, or make it indeterminate if
@@ -388,6 +389,11 @@ void ItemModelObserverBridge::ItemPercentDownloadedChanged() {
base::mac::ObjCCastStrict<AppsGridController>([collectionView delegate]);
size_t pageIndex = [gridController pageIndexForCollectionView:collectionView];
[gridController scrollToPage:pageIndex];
+
+ // If the item just completed a user-initiated install, additionally clear
+ // search results to reveal the item in the grid.
+ if ([self model]->percent_downloaded() == -1)
+ [[gridController paginationObserver] ensureAppsPagesVisible];
}
- (void)setItemIsInstalling:(BOOL)isInstalling {
« no previous file with comments | « ui/app_list/cocoa/apps_grid_controller_unittest.mm ('k') | ui/app_list/cocoa/apps_pagination_model_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698