Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / ui / app_list / cocoa / apps_grid_view_item.mm
index c61b38c..1cc2784 100644 (file)
@@ -50,9 +50,6 @@ const int kMacFontSizeDelta = -1;
 // Update the button image after ensuring its dimensions are |kIconSize|.
 - (void)updateButtonImage;
 
-// 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.
 - (void)setItemIsInstalling:(BOOL)isInstalling;
 
@@ -67,16 +64,15 @@ namespace app_list {
 class ItemModelObserverBridge : public app_list::AppListItemObserver {
  public:
   ItemModelObserverBridge(AppsGridViewItem* parent, AppListItem* model);
-  virtual ~ItemModelObserverBridge();
+  ~ItemModelObserverBridge() override;
 
   AppListItem* model() { return model_; }
   NSMenu* GetContextMenu();
 
-  virtual void ItemIconChanged() OVERRIDE;
-  virtual void ItemNameChanged() OVERRIDE;
-  virtual void ItemHighlightedChanged() OVERRIDE;
-  virtual void ItemIsInstallingChanged() OVERRIDE;
-  virtual void ItemPercentDownloadedChanged() OVERRIDE;
+  void ItemIconChanged() override;
+  void ItemNameChanged() override;
+  void ItemIsInstallingChanged() override;
+  void ItemPercentDownloadedChanged() override;
 
  private:
   AppsGridViewItem* parent_;  // Weak. Owns us.
@@ -118,11 +114,6 @@ void ItemModelObserverBridge::ItemNameChanged() {
   [parent_ updateButtonTitle];
 }
 
-void ItemModelObserverBridge::ItemHighlightedChanged() {
-  if (model_->highlighted())
-    [parent_ ensureVisible];
-}
-
 void ItemModelObserverBridge::ItemIsInstallingChanged() {
   [parent_ setItemIsInstalling:model_->is_installing()];
 }
@@ -357,19 +348,10 @@ void ItemModelObserverBridge::ItemPercentDownloadedChanged() {
   return imageRep;
 }
 
-- (void)ensureVisible {
-  NSCollectionView* collectionView = [self collectionView];
-  AppsGridController* gridController =
-      base::mac::ObjCCastStrict<AppsGridController>([collectionView delegate]);
-  size_t pageIndex = [gridController pageIndexForCollectionView:collectionView];
-  [gridController scrollToPage:pageIndex];
-}
-
 - (void)setItemIsInstalling:(BOOL)isInstalling {
   if (!isInstalling == !progressIndicator_)
     return;
 
-  [self ensureVisible];
   if (!isInstalling) {
     [progressIndicator_ removeFromSuperview];
     progressIndicator_.reset();