Chromium Code Reviews| Index: ios/chrome/browser/ui/context_menu/context_menu_wrangler.h |
| diff --git a/ios/chrome/browser/ui/context_menu/context_menu_wrangler.h b/ios/chrome/browser/ui/context_menu/context_menu_wrangler.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..31eea75b5fc93426be9b867027fad410907fc3a6 |
| --- /dev/null |
| +++ b/ios/chrome/browser/ui/context_menu/context_menu_wrangler.h |
| @@ -0,0 +1,36 @@ |
| +// Copyright 2016 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. |
| + |
| +#ifndef IOS_CHROME_BROWSER_UI_CONTEXT_MENU_CONTEXT_MENU_WRANGLER_H_ |
| +#define IOS_CHROME_BROWSER_UI_CONTEXT_MENU_CONTEXT_MENU_WRANGLER_H_ |
| + |
| +#import <UIKit/UIKit.h> |
| + |
| +#include "base/ios/block_types.h" |
| + |
| +namespace web { |
| +struct ContextMenuParams; |
| +} |
| + |
| +// Abstracts displaying context menus for all device form factors. Will show a |
| +// sheet on the phone and use a popover on a tablet. |
| +@interface ContextMenuWrangler : NSObject |
| + |
| +// Whether the context menu is visible. |
| +@property(nonatomic, readonly, getter=isVisible) BOOL visible; |
|
Eugene But (OOO till 7-30)
2016/05/13 01:23:55
Is this method actually needed?
michaeldo
2016/05/17 18:03:03
It is needed (for now). It is used downstream, I c
|
| + |
| +// Initializes with details provided in |params|. |
| +- (instancetype)initWithContextMenuParams:(const web::ContextMenuParams&)params; |
|
marq (ping after 24h)
2016/05/13 14:51:29
I'd like coordinators to typically accept a view c
michaeldo
2016/05/17 18:03:03
Done.
|
| +// Adds an item at the end of the menu. |
| +- (void)addItemWithTitle:(NSString*)title action:(ProceduralBlock)action; |
| +// Displays the context menu. |
| +- (void)present; |
|
marq (ping after 24h)
2016/05/13 14:51:29
The coordinator's job is to manage a discrete UI i
michaeldo
2016/05/17 18:03:03
Done.
|
| + |
| +// Dismisses displayed context menu. |
| +- (void)dismissAnimated:(BOOL)animated |
|
marq (ping after 24h)
2016/05/13 14:51:29
What's the use case for this being called by exter
michaeldo
2016/05/17 18:03:03
This appears to only be called from "dismissModals
|
| + completionHandler:(ProceduralBlock)completionHandler; |
| + |
| +@end |
| + |
| +#endif // IOS_CHROME_BROWSER_UI_CONTEXT_MENU_CONTEXT_MENU_WRANGLER_H_ |