OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 IOS_WEB_WEB_STATE_UI_CRW_CONTEXT_MENU_PROVIDER_H_ | 4 #ifndef IOS_WEB_WEB_STATE_UI_CRW_CONTEXT_MENU_PROVIDER_H_ |
5 #define IOS_WEB_WEB_STATE_UI_CRW_CONTEXT_MENU_PROVIDER_H_ | 5 #define IOS_WEB_WEB_STATE_UI_CRW_CONTEXT_MENU_PROVIDER_H_ |
6 | 6 |
7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
8 | 8 |
9 @class CRUContextMenuHolder; | |
10 | |
11 // A protocol implemented by a provider of labels and actions for a context | |
12 // menu. | |
13 @protocol CRWContextMenuProvider<NSObject> | |
14 | |
15 // Returns a CRUContextMenuHolder with the titles and actions associated with | |
16 // each menu item. The "Cancel" item is automatically added when constructing | |
17 // the menu for presentation, therefore it should not be added to the list. | |
18 // Each CRWContextMenuProvider might have different requirements for the | |
19 // |contextDictionary|. On a web page |kContextLinkURLString| and | |
20 // |kContextImageURLString| might both be set whereas on a recently visited | |
21 // entry some other identifier will be passed on. | |
22 - (CRUContextMenuHolder*)contextMenuForDictionary:(NSDictionary*)context; | |
23 | |
24 @end | |
25 | |
26 namespace web { | 9 namespace web { |
27 | 10 |
28 // Keys for the contextDictionary. | 11 // Keys for the contextDictionary. |
29 | 12 |
30 // The menu title (as an NSString). | 13 // The menu title (as an NSString). |
31 extern NSString* const kContextTitle; | 14 extern NSString* const kContextTitle; |
32 // The url spec (as an NSString) of the the inner-most wrapping anchor tag to | 15 // The url spec (as an NSString) of the the inner-most wrapping anchor tag to |
33 // the current element. | 16 // the current element. |
34 extern NSString* const kContextLinkURLString; | 17 extern NSString* const kContextLinkURLString; |
35 // The referrer policy to use when opening the link. | 18 // The referrer policy to use when opening the link. |
36 extern NSString* const kContextLinkReferrerPolicy; | 19 extern NSString* const kContextLinkReferrerPolicy; |
37 // The url spec (as an NSString) for the image of the current element. | 20 // The url spec (as an NSString) for the image of the current element. |
38 extern NSString* const kContextImageURLString; | 21 extern NSString* const kContextImageURLString; |
39 | 22 |
40 } // namespace web | 23 } // namespace web |
41 | 24 |
42 #endif // IOS_WEB_WEB_STATE_UI_CRW_CONTEXT_MENU_PROVIDER_H_ | 25 #endif // IOS_WEB_WEB_STATE_UI_CRW_CONTEXT_MENU_PROVIDER_H_ |
OLD | NEW |