| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "content/renderer/context_menu_params_builder.h" | 5 #include "content/renderer/context_menu_params_builder.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "content/public/common/context_menu_params.h" | 9 #include "content/public/common/context_menu_params.h" |
| 10 #include "content/public/renderer/content_renderer_client.h" | 10 #include "content/public/renderer/content_renderer_client.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 params.x = data.mousePosition.x; | 21 params.x = data.mousePosition.x; |
| 22 params.y = data.mousePosition.y; | 22 params.y = data.mousePosition.y; |
| 23 params.link_url = data.linkURL; | 23 params.link_url = data.linkURL; |
| 24 params.unfiltered_link_url = data.linkURL; | 24 params.unfiltered_link_url = data.linkURL; |
| 25 params.src_url = data.srcURL; | 25 params.src_url = data.srcURL; |
| 26 params.has_image_contents = data.hasImageContents; | 26 params.has_image_contents = data.hasImageContents; |
| 27 params.page_url = data.pageURL; | 27 params.page_url = data.pageURL; |
| 28 params.keyword_url = data.keywordURL; | 28 params.keyword_url = data.keywordURL; |
| 29 params.frame_url = data.frameURL; | 29 params.frame_url = data.frameURL; |
| 30 params.media_flags = data.mediaFlags; | 30 params.media_flags = data.mediaFlags; |
| 31 params.selection_text = data.selectedText; | 31 params.selection_text = data.selectedText.utf16(); |
| 32 params.title_text = data.titleText; | 32 params.title_text = data.titleText.utf16(); |
| 33 params.misspelled_word = data.misspelledWord; | 33 params.misspelled_word = data.misspelledWord.utf16(); |
| 34 params.misspelling_hash = data.misspellingHash; | 34 params.misspelling_hash = data.misspellingHash; |
| 35 params.spellcheck_enabled = data.isSpellCheckingEnabled; | 35 params.spellcheck_enabled = data.isSpellCheckingEnabled; |
| 36 params.is_editable = data.isEditable; | 36 params.is_editable = data.isEditable; |
| 37 params.writing_direction_default = data.writingDirectionDefault; | 37 params.writing_direction_default = data.writingDirectionDefault; |
| 38 params.writing_direction_left_to_right = data.writingDirectionLeftToRight; | 38 params.writing_direction_left_to_right = data.writingDirectionLeftToRight; |
| 39 params.writing_direction_right_to_left = data.writingDirectionRightToLeft; | 39 params.writing_direction_right_to_left = data.writingDirectionRightToLeft; |
| 40 params.edit_flags = data.editFlags; | 40 params.edit_flags = data.editFlags; |
| 41 params.frame_charset = data.frameEncoding.utf8(); | 41 params.frame_charset = data.frameEncoding.utf8(); |
| 42 params.referrer_policy = data.referrerPolicy; | 42 params.referrer_policy = data.referrerPolicy; |
| 43 params.suggested_filename = data.suggestedFilename; | 43 params.suggested_filename = data.suggestedFilename.utf16(); |
| 44 params.input_field_type = data.inputFieldType; | 44 params.input_field_type = data.inputFieldType; |
| 45 | 45 |
| 46 if (!data.imageResponse.isNull()) { | 46 if (!data.imageResponse.isNull()) { |
| 47 GetContentClient()->renderer()->AddImageContextMenuProperties( | 47 GetContentClient()->renderer()->AddImageContextMenuProperties( |
| 48 data.imageResponse, ¶ms.properties); | 48 data.imageResponse, ¶ms.properties); |
| 49 } | 49 } |
| 50 | 50 |
| 51 for (size_t i = 0; i < data.dictionarySuggestions.size(); ++i) | 51 for (size_t i = 0; i < data.dictionarySuggestions.size(); ++i) |
| 52 params.dictionary_suggestions.push_back(data.dictionarySuggestions[i]); | 52 params.dictionary_suggestions.push_back( |
| 53 data.dictionarySuggestions[i].utf16()); |
| 53 | 54 |
| 54 params.custom_context.is_pepper_menu = false; | 55 params.custom_context.is_pepper_menu = false; |
| 55 for (size_t i = 0; i < data.customItems.size(); ++i) | 56 for (size_t i = 0; i < data.customItems.size(); ++i) |
| 56 params.custom_items.push_back(MenuItemBuilder::Build(data.customItems[i])); | 57 params.custom_items.push_back(MenuItemBuilder::Build(data.customItems[i])); |
| 57 | 58 |
| 58 if (!data.frameHistoryItem.isNull()) { | 59 if (!data.frameHistoryItem.isNull()) { |
| 59 params.frame_page_state = | 60 params.frame_page_state = |
| 60 SingleHistoryItemToPageState(data.frameHistoryItem); | 61 SingleHistoryItemToPageState(data.frameHistoryItem); |
| 61 } | 62 } |
| 62 | 63 |
| 63 params.link_text = data.linkText; | 64 params.link_text = data.linkText.utf16(); |
| 64 | 65 |
| 65 return params; | 66 return params; |
| 66 } | 67 } |
| 67 | 68 |
| 68 } // namespace content | 69 } // namespace content |
| OLD | NEW |