OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 WEBKIT_GLUE_CONTEXT_MENU_H_ |
6 #define WEBKIT_GLUE_CONTEXT_MENU_H_ | 6 #define WEBKIT_GLUE_CONTEXT_MENU_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // and populating dictionary_suggestions if the type is EDITABLE | 66 // and populating dictionary_suggestions if the type is EDITABLE |
67 // and the misspelled_word is not empty. | 67 // and the misspelled_word is not empty. |
68 std::vector<string16> dictionary_suggestions; | 68 std::vector<string16> dictionary_suggestions; |
69 | 69 |
70 // If editable, flag for whether spell check is enabled or not. | 70 // If editable, flag for whether spell check is enabled or not. |
71 bool spellcheck_enabled; | 71 bool spellcheck_enabled; |
72 | 72 |
73 // Whether context is editable. | 73 // Whether context is editable. |
74 bool is_editable; | 74 bool is_editable; |
75 | 75 |
| 76 #if defined(OS_MACOSX) |
| 77 // Writing direction menu items. |
| 78 // Currently only used on OS X. |
| 79 int writing_direction_default; |
| 80 int writing_direction_left_to_right; |
| 81 int writing_direction_right_to_left; |
| 82 #endif // OS_MACOSX |
| 83 |
76 // These flags indicate to the browser whether the renderer believes it is | 84 // These flags indicate to the browser whether the renderer believes it is |
77 // able to perform the corresponding action. | 85 // able to perform the corresponding action. |
78 int edit_flags; | 86 int edit_flags; |
79 | 87 |
80 // The security info for the resource we are showing the menu on. | 88 // The security info for the resource we are showing the menu on. |
81 std::string security_info; | 89 std::string security_info; |
82 | 90 |
83 // The character encoding of the frame on which the menu is invoked. | 91 // The character encoding of the frame on which the menu is invoked. |
84 std::string frame_charset; | 92 std::string frame_charset; |
85 | 93 |
86 std::vector<WebMenuItem> custom_items; | 94 std::vector<WebMenuItem> custom_items; |
87 | 95 |
88 ContextMenuParams() {} | 96 ContextMenuParams() {} |
89 | 97 |
90 ContextMenuParams(const WebKit::WebContextMenuData& data) | 98 ContextMenuParams(const WebKit::WebContextMenuData& data) |
91 : media_type(data.mediaType), | 99 : media_type(data.mediaType), |
92 x(data.mousePosition.x), | 100 x(data.mousePosition.x), |
93 y(data.mousePosition.y), | 101 y(data.mousePosition.y), |
94 link_url(data.linkURL), | 102 link_url(data.linkURL), |
95 unfiltered_link_url(data.linkURL), | 103 unfiltered_link_url(data.linkURL), |
96 src_url(data.srcURL), | 104 src_url(data.srcURL), |
97 page_url(data.pageURL), | 105 page_url(data.pageURL), |
98 frame_url(data.frameURL), | 106 frame_url(data.frameURL), |
99 media_flags(data.mediaFlags), | 107 media_flags(data.mediaFlags), |
100 selection_text(UTF16ToWideHack(data.selectedText)), | 108 selection_text(UTF16ToWideHack(data.selectedText)), |
101 misspelled_word(data.misspelledWord), | 109 misspelled_word(data.misspelledWord), |
102 spellcheck_enabled(data.isSpellCheckingEnabled), | 110 spellcheck_enabled(data.isSpellCheckingEnabled), |
103 is_editable(data.isEditable), | 111 is_editable(data.isEditable), |
| 112 #if defined(OS_MACOSX) |
| 113 writing_direction_default(data.writingDirectionDefault), |
| 114 writing_direction_left_to_right(data.writingDirectionLeftToRight), |
| 115 writing_direction_right_to_left(data.writingDirectionRightToLeft), |
| 116 #endif // OS_MACOSX |
104 edit_flags(data.editFlags), | 117 edit_flags(data.editFlags), |
105 security_info(data.securityInfo), | 118 security_info(data.securityInfo), |
106 frame_charset(data.frameEncoding.utf8()) { | 119 frame_charset(data.frameEncoding.utf8()) { |
107 for (size_t i = 0; i < data.customItems.size(); ++i) | 120 for (size_t i = 0; i < data.customItems.size(); ++i) |
108 custom_items.push_back(WebMenuItem(data.customItems[i])); | 121 custom_items.push_back(WebMenuItem(data.customItems[i])); |
109 } | 122 } |
110 }; | 123 }; |
111 | 124 |
112 #endif // WEBKIT_GLUE_CONTEXT_MENU_H_ | 125 #endif // WEBKIT_GLUE_CONTEXT_MENU_H_ |
OLD | NEW |