| 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_model.h" | 8 #include "ui/app_list/app_list_model.h" |
| 9 #include "ui/app_list/app_list_model_observer.h" | 9 #include "ui/app_list/app_list_model_observer.h" |
| 10 #include "ui/app_list/app_list_view_delegate.h" | 10 #include "ui/app_list/app_list_view_delegate.h" |
| (...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 | 375 |
| 376 visiblePage_ = newPage; | 376 visiblePage_ = newPage; |
| 377 [paginationObserver_ selectedPageChanged:newPage]; | 377 [paginationObserver_ selectedPageChanged:newPage]; |
| 378 [paginationObserver_ pageVisibilityChanged]; | 378 [paginationObserver_ pageVisibilityChanged]; |
| 379 } | 379 } |
| 380 | 380 |
| 381 - (void)onItemClicked:(id)sender { | 381 - (void)onItemClicked:(id)sender { |
| 382 for (size_t i = 0; i < [items_ count]; ++i) { | 382 for (size_t i = 0; i < [items_ count]; ++i) { |
| 383 AppsGridViewItem* item = [self itemAtIndex:i]; | 383 AppsGridViewItem* item = [self itemAtIndex:i]; |
| 384 if ([[item button] isEqual:sender]) | 384 if ([[item button] isEqual:sender]) |
| 385 delegate_->ActivateAppListItem([item model], 0); | 385 [item model]->Activate(0); |
| 386 } | 386 } |
| 387 } | 387 } |
| 388 | 388 |
| 389 - (AppsGridViewItem*)itemAtPageIndex:(size_t)pageIndex | 389 - (AppsGridViewItem*)itemAtPageIndex:(size_t)pageIndex |
| 390 indexInPage:(size_t)indexInPage { | 390 indexInPage:(size_t)indexInPage { |
| 391 return base::mac::ObjCCastStrict<AppsGridViewItem>( | 391 return base::mac::ObjCCastStrict<AppsGridViewItem>( |
| 392 [[self collectionViewAtPageIndex:pageIndex] itemAtIndex:indexInPage]); | 392 [[self collectionViewAtPageIndex:pageIndex] itemAtIndex:indexInPage]); |
| 393 } | 393 } |
| 394 | 394 |
| 395 - (AppsGridViewItem*)itemAtIndex:(size_t)itemIndex { | 395 - (AppsGridViewItem*)itemAtIndex:(size_t)itemIndex { |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 return [self moveSelectionByDelta:-kItemsPerPage]; | 670 return [self moveSelectionByDelta:-kItemsPerPage]; |
| 671 | 671 |
| 672 if (command == @selector(pageDown:) || | 672 if (command == @selector(pageDown:) || |
| 673 command == @selector(scrollPageDown:)) | 673 command == @selector(scrollPageDown:)) |
| 674 return [self moveSelectionByDelta:kItemsPerPage]; | 674 return [self moveSelectionByDelta:kItemsPerPage]; |
| 675 | 675 |
| 676 return NO; | 676 return NO; |
| 677 } | 677 } |
| 678 | 678 |
| 679 @end | 679 @end |
| OLD | NEW |