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..2aa08effd94236779ec945dbc76efe25caf49325 |
| --- /dev/null |
| +++ b/ios/chrome/browser/ui/context_menu/context_menu_wrangler.h |
| @@ -0,0 +1,33 @@ |
| +// 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_ |
| + |
| +#include "base/ios/block_types.h" |
| +#import "ios/chrome/browser/ui/context_menu/context_menu_controller.h" |
| + |
| +namespace web { |
| +struct ContextMenuParams; |
| +} |
| + |
| +// Abstracts displaying context menus for all device form factors, given a |
| +// ContextMenuHolder with the title and action to associate to each menu |
|
Eugene But (OOO till 7-30)
2016/05/12 22:27:48
Please update comments, it does not use take Conte
michaeldo
2016/05/12 23:32:43
Done.
|
| +// item. Will show a sheet on the phone and use a popover on a tablet. |
| +@interface ContextMenuWrangler : ContextMenuController |
|
Eugene But (OOO till 7-30)
2016/05/12 22:27:48
Probably there is no need for subclassing.
michaeldo
2016/05/12 23:32:43
Done.
|
| + |
| +// Initialize with details provided in |params|. |
|
Eugene But (OOO till 7-30)
2016/05/12 22:27:48
s/Initialize/Initializes
michaeldo
2016/05/12 23:32:43
Done.
|
| +- (instancetype)initWithContextMenuParams:(const web::ContextMenuParams&)params; |
| +// Adds an item at the end of the menu. |
| +- (void)appendItemWithTitle:(NSString*)title action:(ProceduralBlock)action; |
|
Eugene But (OOO till 7-30)
2016/05/12 22:27:48
s/append/add ? which is a common add action in Obj
michaeldo
2016/05/12 23:32:43
I think you're right. Add seems better. Append is
|
| +// Displays the context menu. |
| +- (void)present; |
| + |
| +// Dismisses displayed context menu. |
| +- (void)dismissAnimated:(BOOL)animated |
| + completionHandler:(ProceduralBlock)completionHandler; |
| + |
| +@end |
| + |
| +#endif // IOS_CHROME_BROWSER_UI_CONTEXT_MENU_CONTEXT_MENU_WRANGLER_H_ |