| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/base/ios/cru_context_menu_holder.h" | 5 #import "ios/chrome/browser/ui/context_menu/context_menu_holder.h" |
| 6 | 6 |
| 7 #import "base/logging.h" | 7 #import "base/logging.h" |
| 8 #import "base/mac/scoped_nsobject.h" | 8 #import "base/mac/scoped_nsobject.h" |
| 9 | 9 |
| 10 @implementation CRUContextMenuHolder { | 10 @implementation ContextMenuHolder { |
| 11 // Backs the property of the same name. | 11 // Backs the property of the same name. |
| 12 base::scoped_nsobject<NSString> _menuTitle; | 12 base::scoped_nsobject<NSString> _menuTitle; |
| 13 // Stores the itemTitles of the menu items. | 13 // Stores the itemTitles of the menu items. |
| 14 base::scoped_nsobject<NSMutableArray> _itemTitles; | 14 base::scoped_nsobject<NSMutableArray> _itemTitles; |
| 15 // Keep a copy of all the actions blocks. | 15 // Keep a copy of all the actions blocks. |
| 16 base::scoped_nsobject<NSMutableArray> _actions; | 16 base::scoped_nsobject<NSMutableArray> _actions; |
| 17 // A set of indices in |_actions| that should cause the context menu to be | 17 // A set of indices in |_actions| that should cause the context menu to be |
| 18 // dismissed without animation when tapped. | 18 // dismissed without animation when tapped. |
| 19 base::scoped_nsobject<NSMutableIndexSet> _dismissImmediatelyActions; | 19 base::scoped_nsobject<NSMutableIndexSet> _dismissImmediatelyActions; |
| 20 } | 20 } |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 - (void)performActionAtIndex:(NSUInteger)index { | 66 - (void)performActionAtIndex:(NSUInteger)index { |
| 67 static_cast<ProceduralBlock>([_actions objectAtIndex:index])(); | 67 static_cast<ProceduralBlock>([_actions objectAtIndex:index])(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 - (BOOL)shouldDismissImmediatelyOnClickedAtIndex:(NSUInteger)index { | 70 - (BOOL)shouldDismissImmediatelyOnClickedAtIndex:(NSUInteger)index { |
| 71 return [_dismissImmediatelyActions containsIndex:index]; | 71 return [_dismissImmediatelyActions containsIndex:index]; |
| 72 } | 72 } |
| 73 | 73 |
| 74 @end | 74 @end |
| OLD | NEW |