OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #import "ui/app_list/cocoa/apps_grid_controller.h" | 5 #import "ui/app_list/cocoa/apps_grid_controller.h" |
6 | 6 |
7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
8 #include "ui/app_list/app_list_item.h" | 8 #include "ui/app_list/app_list_item.h" |
9 #include "ui/app_list/app_list_model.h" | 9 #include "ui/app_list/app_list_model.h" |
10 #include "ui/app_list/app_list_model_observer.h" | 10 #include "ui/app_list/app_list_model_observer.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 virtual void OnListItemRemoved(size_t index, AppListItem* item) override { | 105 virtual void OnListItemRemoved(size_t index, AppListItem* item) override { |
106 [parent_ listItemRemoved:index]; | 106 [parent_ listItemRemoved:index]; |
107 } | 107 } |
108 virtual void OnListItemMoved(size_t from_index, | 108 virtual void OnListItemMoved(size_t from_index, |
109 size_t to_index, | 109 size_t to_index, |
110 AppListItem* item) override { | 110 AppListItem* item) override { |
111 [parent_ listItemMovedFromIndex:from_index | 111 [parent_ listItemMovedFromIndex:from_index |
112 toModelIndex:to_index]; | 112 toModelIndex:to_index]; |
113 } | 113 } |
114 virtual void OnAppListItemHighlight(size_t index, bool highlight) OVERRIDE { | 114 virtual void OnAppListItemHighlight(size_t index, bool highlight) override { |
115 // NSCollectionView (or -[AppsGridController scrollToPage]) ensures only one | 115 // NSCollectionView (or -[AppsGridController scrollToPage]) ensures only one |
116 // item is highlighted, so clearing a highlight isn't necessary. | 116 // item is highlighted, so clearing a highlight isn't necessary. |
117 if (!highlight) | 117 if (!highlight) |
118 return; | 118 return; |
119 | 119 |
120 [parent_ selectItemAtIndex:index]; | 120 [parent_ selectItemAtIndex:index]; |
121 [parent_ scrollToPage:index / kItemsPerPage]; | 121 [parent_ scrollToPage:index / kItemsPerPage]; |
122 } | 122 } |
123 | 123 |
124 AppsGridController* parent_; // Weak, owns us. | 124 AppsGridController* parent_; // Weak, owns us. |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 return [self moveSelectionByDelta:-kItemsPerPage]; | 675 return [self moveSelectionByDelta:-kItemsPerPage]; |
676 | 676 |
677 if (command == @selector(pageDown:) || | 677 if (command == @selector(pageDown:) || |
678 command == @selector(scrollPageDown:)) | 678 command == @selector(scrollPageDown:)) |
679 return [self moveSelectionByDelta:kItemsPerPage]; | 679 return [self moveSelectionByDelta:kItemsPerPage]; |
680 | 680 |
681 return NO; | 681 return NO; |
682 } | 682 } |
683 | 683 |
684 @end | 684 @end |
OLD | NEW |