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 #ifndef UI_BASE_IOS_CRU_CONTEXT_MENU_CONTROLLER_H_ | 4 #ifndef IOS_CHROME_BROWSER_UI_CONTEXT_MENU_CONTEXT_MENU_CONTROLLER_H_ |
5 #define UI_BASE_IOS_CRU_CONTEXT_MENU_CONTROLLER_H_ | 5 #define IOS_CHROME_BROWSER_UI_CONTEXT_MENU_CONTEXT_MENU_CONTROLLER_H_ |
6 | 6 |
7 #import <UIKit/UIKit.h> | 7 #import <UIKit/UIKit.h> |
8 | 8 |
9 #include "base/ios/block_types.h" | 9 #include "base/ios/block_types.h" |
10 | 10 |
11 @class CRUContextMenuHolder; | 11 @class ContextMenuHolder; |
12 | 12 |
13 // Abstracts displaying context menus for all device form factors, given a | 13 // Abstracts displaying context menus for all device form factors, given a |
14 // CRUContextMenuHolder with the title and action to associate to each menu | 14 // ContextMenuHolder with the title and action to associate to each menu |
15 // item. Will show a sheet on the phone and use a popover on a tablet. | 15 // item. Will show a sheet on the phone and use a popover on a tablet. |
16 @interface CRUContextMenuController : NSObject | 16 @interface ContextMenuController : NSObject |
17 | 17 |
18 // Whether the context menu is visible. | 18 // Whether the context menu is visible. |
19 @property(nonatomic, readonly, getter=isVisible) BOOL visible; | 19 @property(nonatomic, readonly, getter=isVisible) BOOL visible; |
20 | 20 |
21 // Displays a context menu. If on a tablet, |localPoint| is the point in | 21 // Displays a context menu. If on a tablet, |localPoint| is the point in |
22 // |view|'s coordinates to show the popup. If a phone, |localPoint| is unused | 22 // |view|'s coordinates to show the popup. If a phone, |localPoint| is unused |
23 // since the display is a sheet, but |view| is still used to attach the sheet to | 23 // since the display is a sheet, but |view| is still used to attach the sheet to |
24 // the given view. | 24 // the given view. |
25 // The |menuHolder| that will be put in the menu. | 25 // The |menuHolder| that will be put in the menu. |
26 - (void)showWithHolder:(CRUContextMenuHolder*)menuHolder | 26 - (void)showWithHolder:(ContextMenuHolder*)menuHolder |
27 atPoint:(CGPoint)localPoint | 27 atPoint:(CGPoint)localPoint |
28 inView:(UIView*)view; | 28 inView:(UIView*)view; |
29 | 29 |
30 // Dismisses displayed context menu. | 30 // Dismisses displayed context menu. |
31 - (void)dismissAnimated:(BOOL)animated | 31 - (void)dismissAnimated:(BOOL)animated |
32 completionHandler:(ProceduralBlock)completionHandler; | 32 completionHandler:(ProceduralBlock)completionHandler; |
33 | 33 |
34 @end | 34 @end |
35 | 35 |
36 #endif // UI_BASE_IOS_CRU_CONTEXT_MENU_CONTROLLER_H_ | 36 #endif // IOS_CHROME_BROWSER_UI_CONTEXT_MENU_CONTEXT_MENU_CONTROLLER_H_ |
OLD | NEW |