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 | 4 |
5 #ifndef IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_NATIVE_CONTENT_H_ | 5 #ifndef IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_NATIVE_CONTENT_H_ |
6 #define IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_NATIVE_CONTENT_H_ | 6 #define IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_NATIVE_CONTENT_H_ |
7 | 7 |
8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
9 | 9 |
10 #import "ios/web/public/block_types.h" | 10 #import "ios/web/public/block_types.h" |
11 #include "url/gurl.h" | 11 #include "url/gurl.h" |
12 | 12 |
| 13 namespace web { |
| 14 struct ContextMenuParams; |
| 15 } // namespace web; |
| 16 |
13 @protocol CRWNativeContentDelegate; | 17 @protocol CRWNativeContentDelegate; |
14 | 18 |
15 // Abstract methods needed for manipulating native content in the web content | 19 // Abstract methods needed for manipulating native content in the web content |
16 // area. | 20 // area. |
17 @protocol CRWNativeContent<NSObject> | 21 @protocol CRWNativeContent<NSObject> |
18 | 22 |
19 // The page title, meant for display to the user. Will return nil if not | 23 // The page title, meant for display to the user. Will return nil if not |
20 // available. | 24 // available. |
21 - (NSString*)title; | 25 - (NSString*)title; |
22 | 26 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 98 |
95 @end | 99 @end |
96 | 100 |
97 // CRWNativeContent delegate protocol. | 101 // CRWNativeContent delegate protocol. |
98 @protocol CRWNativeContentDelegate<NSObject> | 102 @protocol CRWNativeContentDelegate<NSObject> |
99 | 103 |
100 @optional | 104 @optional |
101 // Called when the content supplies a new title. | 105 // Called when the content supplies a new title. |
102 - (void)nativeContent:(id)content titleDidChange:(NSString*)title; | 106 - (void)nativeContent:(id)content titleDidChange:(NSString*)title; |
103 | 107 |
| 108 // Called when the content triggers a context menu. |
| 109 // The client must return whether the context menu event was handled and the |
| 110 // system menu must be suppressed. |
| 111 - (BOOL)nativeContent:(id)content |
| 112 handleContextMenu:(const web::ContextMenuParams&)params; |
| 113 |
104 @end | 114 @end |
105 | 115 |
106 #endif // IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_NATIVE_CONTENT_H_ | 116 #endif // IOS_WEB_PUBLIC_WEB_STATE_UI_CRW_NATIVE_CONTENT_H_ |
OLD | NEW |