Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Side by Side Diff: ios/web/public/web_state/context_menu_params.h

Issue 2640433002: Clean the new CRWContextMenuController (Closed)
Patch Set: feedback Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_PUBLIC_WEB_STATE_CONTEXT_MENU_PARAMS_H_ 4 #ifndef IOS_WEB_PUBLIC_WEB_STATE_CONTEXT_MENU_PARAMS_H_
5 #define IOS_WEB_PUBLIC_WEB_STATE_CONTEXT_MENU_PARAMS_H_ 5 #define IOS_WEB_PUBLIC_WEB_STATE_CONTEXT_MENU_PARAMS_H_
6 6
7 #import <UIKit/UIKit.h> 7 #import <UIKit/UIKit.h>
8 8
9 #import "base/mac/scoped_nsobject.h" 9 #import "base/mac/scoped_nsobject.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
11 #include "ios/web/public/referrer.h" 11 #include "ios/web/public/referrer.h"
12 #include "url/gurl.h" 12 #include "url/gurl.h"
13 13
14 namespace web { 14 namespace web {
15 15
16 // Wraps information needed to show a context menu. 16 // Wraps information needed to show a context menu.
17 struct ContextMenuParams { 17 struct ContextMenuParams {
18 public: 18 public:
19 ContextMenuParams(); 19 ContextMenuParams();
20 ContextMenuParams(const ContextMenuParams& other); 20 ContextMenuParams(const ContextMenuParams& other);
21 ~ContextMenuParams(); 21 ~ContextMenuParams();
22 22
23 // Convenience constructor that creates a ContextMenuParams from a
24 // NSDictionary representing an HTML element.
25 // The fields "href", "src", "title", "referrerPolicy" and "innerText" will
26 // be used (if present) to generate the ContextMenuParams.
27 // All these fields must be NSString*.
28 // This constructor does not set fields relative to the touch event (view and
29 // location).
30 ContextMenuParams(NSDictionary* element);
Eugene But (OOO till 7-30) 2017/01/17 18:12:48 This method is specific to ios/web implementation
Olivier 2017/01/18 08:55:54 I hesitated :) Done.
31
23 // The title of the menu. 32 // The title of the menu.
24 base::scoped_nsobject<NSString> menu_title; 33 base::scoped_nsobject<NSString> menu_title;
25 34
26 // The URL of the link that encloses the node the context menu was invoked on. 35 // The URL of the link that encloses the node the context menu was invoked on.
27 GURL link_url; 36 GURL link_url;
28 37
29 // The source URL of the element the context menu was invoked on. Example of 38 // The source URL of the element the context menu was invoked on. Example of
30 // elements with source URLs are img, audio, and video. 39 // elements with source URLs are img, audio, and video.
31 GURL src_url; 40 GURL src_url;
32 41
33 // The referrer policy to use when opening the link. 42 // The referrer policy to use when opening the link.
34 web::ReferrerPolicy referrer_policy; 43 web::ReferrerPolicy referrer_policy;
35 44
36 // The view in which to present the menu. 45 // The view in which to present the menu.
37 base::scoped_nsobject<UIView> view; 46 base::scoped_nsobject<UIView> view;
38 47
39 // The location in |view| to present the menu. 48 // The location in |view| to present the menu.
40 CGPoint location; 49 CGPoint location;
41 50
42 // The text associated with the link. It is either nil or nonempty (it can not 51 // The text associated with the link. It is either nil or nonempty (it can not
43 // be empty). 52 // be empty).
44 base::scoped_nsobject<NSString> link_text; 53 base::scoped_nsobject<NSString> link_text;
45 }; 54 };
46 55
47 } // namespace web 56 } // namespace web
48 57
49 #endif // IOS_WEB_PUBLIC_WEB_STATE_CONTEXT_MENU_PARAMS_H_ 58 #endif // IOS_WEB_PUBLIC_WEB_STATE_CONTEXT_MENU_PARAMS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698