Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 | 4 |
| 5 #ifndef WEBKIT_GLUE_CONTEXT_MENU_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_CONTEXT_MENU_PARAMS_H_ |
| 6 #define WEBKIT_GLUE_CONTEXT_MENU_H_ | 6 #define CONTENT_PUBLIC_COMMON_CONTEXT_MENU_PARAMS_H_ |
| 7 #pragma once | |
| 7 | 8 |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 11 #include "base/string16.h" | 12 #include "base/string16.h" |
| 12 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
| 13 #include "webkit/glue/webkit_glue_export.h" | 14 #include "content/common/content_export.h" |
| 15 #include "content/public/common/ssl_status.h" | |
| 14 #include "webkit/glue/webmenuitem.h" | 16 #include "webkit/glue/webmenuitem.h" |
| 15 | |
| 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebContextMenuData.h" |
| 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebReferrerPolicy.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebReferrerPolicy.h" |
| 18 | 19 |
| 19 namespace webkit_glue { | 20 namespace content { |
| 20 | 21 |
| 21 struct CustomContextMenuContext { | 22 struct CustomContextMenuContext { |
|
darin (slow to review)
2012/02/12 20:02:56
why not put CONTENT_EXPORT on the struct as you do
jam
2012/02/12 20:41:01
I had just copied it without much thinking, Done.
| |
| 23 CONTENT_EXPORT static const int32 kCurrentRenderWidget; | |
| 24 | |
| 25 CONTENT_EXPORT CustomContextMenuContext(); | |
| 26 | |
| 22 bool is_pepper_menu; | 27 bool is_pepper_menu; |
| 23 int request_id; | 28 int request_id; |
| 24 // The routing ID of the render widget on which the context menu is shown. | 29 // The routing ID of the render widget on which the context menu is shown. |
| 25 // It could also be |kCurrentRenderWidget|, which means the render widget that | 30 // It could also be |kCurrentRenderWidget|, which means the render widget that |
| 26 // the corresponding ViewHostMsg_ContextMenu is sent to. | 31 // the corresponding ViewHostMsg_ContextMenu is sent to. |
| 27 int32 render_widget_id; | 32 int32 render_widget_id; |
| 28 WEBKIT_GLUE_EXPORT static const int32 kCurrentRenderWidget; | |
| 29 | |
| 30 WEBKIT_GLUE_EXPORT CustomContextMenuContext(); | |
| 31 }; | 33 }; |
| 32 | 34 |
| 33 } // namespace webkit_glue | |
| 34 | |
| 35 // TODO(viettrungluu): Put this in the webkit_glue namespace. | |
| 36 // Parameters structure for ViewHostMsg_ContextMenu. | |
| 37 // FIXME(beng): This would be more useful in the future and more efficient | 35 // FIXME(beng): This would be more useful in the future and more efficient |
| 38 // if the parameters here weren't so literally mapped to what | 36 // if the parameters here weren't so literally mapped to what |
| 39 // they contain for the ContextMenu task. It might be better | 37 // they contain for the ContextMenu task. It might be better |
| 40 // to make the string fields more generic so that this object | 38 // to make the string fields more generic so that this object |
| 41 // could be used for more contextual actions. | 39 // could be used for more contextual actions. |
| 42 struct WEBKIT_GLUE_EXPORT ContextMenuParams { | 40 struct CONTENT_EXPORT ContextMenuParams { |
| 41 ContextMenuParams(); | |
| 42 ContextMenuParams(const WebKit::WebContextMenuData& data); | |
| 43 ~ContextMenuParams(); | |
| 44 | |
| 43 // This is the type of Context Node that the context menu was invoked on. | 45 // This is the type of Context Node that the context menu was invoked on. |
| 44 WebKit::WebContextMenuData::MediaType media_type; | 46 WebKit::WebContextMenuData::MediaType media_type; |
| 45 | 47 |
| 46 // These values represent the coordinates of the mouse when the context menu | 48 // These values represent the coordinates of the mouse when the context menu |
| 47 // was invoked. Coords are relative to the associated RenderView's origin. | 49 // was invoked. Coords are relative to the associated RenderView's origin. |
| 48 int x; | 50 int x; |
| 49 int y; | 51 int y; |
| 50 | 52 |
| 51 // This is the URL of the link that encloses the node the context menu was | 53 // This is the URL of the link that encloses the node the context menu was |
| 52 // invoked on. | 54 // invoked on. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 int writing_direction_default; | 117 int writing_direction_default; |
| 116 int writing_direction_left_to_right; | 118 int writing_direction_left_to_right; |
| 117 int writing_direction_right_to_left; | 119 int writing_direction_right_to_left; |
| 118 #endif // OS_MACOSX | 120 #endif // OS_MACOSX |
| 119 | 121 |
| 120 // These flags indicate to the browser whether the renderer believes it is | 122 // These flags indicate to the browser whether the renderer believes it is |
| 121 // able to perform the corresponding action. | 123 // able to perform the corresponding action. |
| 122 int edit_flags; | 124 int edit_flags; |
| 123 | 125 |
| 124 // The security info for the resource we are showing the menu on. | 126 // The security info for the resource we are showing the menu on. |
| 125 std::string security_info; | 127 SSLStatus security_info; |
| 126 | 128 |
| 127 // The character encoding of the frame on which the menu is invoked. | 129 // The character encoding of the frame on which the menu is invoked. |
| 128 std::string frame_charset; | 130 std::string frame_charset; |
| 129 | 131 |
| 130 // The referrer policy of the frame on which the menu is invoked. | 132 // The referrer policy of the frame on which the menu is invoked. |
| 131 WebKit::WebReferrerPolicy referrer_policy; | 133 WebKit::WebReferrerPolicy referrer_policy; |
| 132 | 134 |
| 133 webkit_glue::CustomContextMenuContext custom_context; | 135 CustomContextMenuContext custom_context; |
| 134 std::vector<WebMenuItem> custom_items; | 136 std::vector<WebMenuItem> custom_items; |
| 135 | |
| 136 ContextMenuParams(); | |
| 137 ContextMenuParams(const WebKit::WebContextMenuData& data); | |
| 138 ~ContextMenuParams(); | |
| 139 }; | 137 }; |
| 140 | 138 |
| 141 #endif // WEBKIT_GLUE_CONTEXT_MENU_H_ | 139 } // namespace content |
| 140 | |
| 141 #endif // CONTENT_PUBLIC_COMMON_CONTEXT_MENU_PARAMS_H_ | |
| OLD | NEW |