Drive: Add BatchableRequest subclass.
[chromium-blink-merge.git] / ui / base / ios / cru_context_menu_controller.h
blob66fdf9d86c1b7467adb6dfc1a53900e84345a0d0
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
3 // found in the LICENSE file.
4 #ifndef UI_BASE_IOS_CRU_CONTEXT_MENU_CONTROLLER_H_
5 #define UI_BASE_IOS_CRU_CONTEXT_MENU_CONTROLLER_H_
7 #import <UIKit/UIKit.h>
9 @class CRUContextMenuHolder;
11 // Abstracts displaying context menus for all device form factors, given a
12 // CRUContextMenuHolder with the title and action to associate to each menu
13 // item. Will show a sheet on the phone and use a popover on a tablet.
14 @interface CRUContextMenuController : NSObject<UIActionSheetDelegate,
15 UIPopoverControllerDelegate>
16 // Displays a context menu. If on a tablet, |localPoint| is the point in
17 // |view|'s coordinates to show the popup. If a phone, |localPoint| is unused
18 // since the display is a sheet, but |view| is still used to attach the sheet to
19 // the given view.
20 // The |menuHolder| that will be put in the menu.
21 - (void)showWithHolder:(CRUContextMenuHolder*)menuHolder
22 atPoint:(CGPoint)localPoint
23 inView:(UIView*)view;
25 // Returns whether the context menu is visible.
26 - (BOOL)isVisible;
28 @end
30 @interface CRUContextMenuController (UsedForTesting)
31 @property (readonly) UIActionSheet* sheet;
32 @end
34 #endif // UI_BASE_IOS_CRU_CONTEXT_MENU_CONTROLLER_H_