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

Unified Diff: ui/base/ios/cru_context_menu_holder.mm

Issue 1885043012: Remove ui/base/ios (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@context_menu_copy
Patch Set: Remove CRWContextMenuProvider Created 4 years, 8 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
« no previous file with comments | « ui/base/ios/cru_context_menu_holder.h ('k') | ui/base/ui_base.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/ios/cru_context_menu_holder.mm
diff --git a/ui/base/ios/cru_context_menu_holder.mm b/ui/base/ios/cru_context_menu_holder.mm
deleted file mode 100644
index e8e9ee9c348265d04f38c630aa3251e511ac36d6..0000000000000000000000000000000000000000
--- a/ui/base/ios/cru_context_menu_holder.mm
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import "ui/base/ios/cru_context_menu_holder.h"
-
-#import "base/logging.h"
-#import "base/mac/scoped_nsobject.h"
-
-@implementation CRUContextMenuHolder {
- // Backs the property of the same name.
- base::scoped_nsobject<NSString> _menuTitle;
- // Stores the itemTitles of the menu items.
- base::scoped_nsobject<NSMutableArray> _itemTitles;
- // Keep a copy of all the actions blocks.
- base::scoped_nsobject<NSMutableArray> _actions;
- // A set of indices in |_actions| that should cause the context menu to be
- // dismissed without animation when tapped.
- base::scoped_nsobject<NSMutableIndexSet> _dismissImmediatelyActions;
-}
-
-- (instancetype)init {
- self = [super init];
- if (self) {
- _itemTitles.reset([[NSMutableArray alloc] init]);
- _actions.reset([[NSMutableArray alloc] init]);
- _dismissImmediatelyActions.reset([[NSMutableIndexSet alloc] init]);
- }
- return self;
-}
-
-- (NSString*)menuTitle {
- return _menuTitle;
-}
-
-- (void)setMenuTitle:(NSString*)newTitle {
- _menuTitle.reset([newTitle copy]);
-}
-
-- (NSArray*)itemTitles {
- return [[_itemTitles copy] autorelease];
-}
-
-- (NSUInteger)itemCount {
- return [_itemTitles count];
-}
-
-- (void)appendItemWithTitle:(NSString*)title action:(ProceduralBlock)action {
- [self appendItemWithTitle:title action:action dismissImmediately:NO];
-}
-
-- (void)appendItemWithTitle:(NSString*)title
- action:(ProceduralBlock)action
- dismissImmediately:(BOOL)dismissImmediately {
- DCHECK(title && action);
- [_itemTitles addObject:title];
- // The action block needs to receive the copy message in order to freeze the
- // stack data it uses. Only then can it be safely retained by the array.
- base::scoped_nsprotocol<id> heapAction([action copy]);
- [_actions addObject:heapAction];
- if (dismissImmediately) {
- [_dismissImmediatelyActions addIndex:[_actions count] - 1];
- }
-}
-
-- (void)performActionAtIndex:(NSUInteger)index {
- static_cast<ProceduralBlock>([_actions objectAtIndex:index])();
-}
-
-- (BOOL)shouldDismissImmediatelyOnClickedAtIndex:(NSUInteger)index {
- return [_dismissImmediatelyActions containsIndex:index];
-}
-
-@end
« no previous file with comments | « ui/base/ios/cru_context_menu_holder.h ('k') | ui/base/ui_base.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698