| 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 23 matching lines...) Expand all Loading... |
| 34 params.spellcheck_enabled = data.is_spell_checking_enabled; | 34 params.spellcheck_enabled = data.is_spell_checking_enabled; |
| 35 params.is_editable = data.is_editable; | 35 params.is_editable = data.is_editable; |
| 36 params.writing_direction_default = data.writing_direction_default; | 36 params.writing_direction_default = data.writing_direction_default; |
| 37 params.writing_direction_left_to_right = data.writing_direction_left_to_right; | 37 params.writing_direction_left_to_right = data.writing_direction_left_to_right; |
| 38 params.writing_direction_right_to_left = data.writing_direction_right_to_left; | 38 params.writing_direction_right_to_left = data.writing_direction_right_to_left; |
| 39 params.edit_flags = data.edit_flags; | 39 params.edit_flags = data.edit_flags; |
| 40 params.frame_charset = data.frame_encoding.Utf8(); | 40 params.frame_charset = data.frame_encoding.Utf8(); |
| 41 params.referrer_policy = data.referrer_policy; | 41 params.referrer_policy = data.referrer_policy; |
| 42 params.suggested_filename = data.suggested_filename.Utf16(); | 42 params.suggested_filename = data.suggested_filename.Utf16(); |
| 43 params.input_field_type = data.input_field_type; | 43 params.input_field_type = data.input_field_type; |
| 44 params.from_touch = data.from_touch; |
| 44 | 45 |
| 45 if (!data.image_response.IsNull()) { | 46 if (!data.image_response.IsNull()) { |
| 46 GetContentClient()->renderer()->AddImageContextMenuProperties( | 47 GetContentClient()->renderer()->AddImageContextMenuProperties( |
| 47 data.image_response, ¶ms.properties); | 48 data.image_response, ¶ms.properties); |
| 48 } | 49 } |
| 49 | 50 |
| 50 for (size_t i = 0; i < data.dictionary_suggestions.size(); ++i) | 51 for (size_t i = 0; i < data.dictionary_suggestions.size(); ++i) |
| 51 params.dictionary_suggestions.push_back( | 52 params.dictionary_suggestions.push_back( |
| 52 data.dictionary_suggestions[i].Utf16()); | 53 data.dictionary_suggestions[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.custom_items.size(); ++i) | 56 for (size_t i = 0; i < data.custom_items.size(); ++i) |
| 56 params.custom_items.push_back(MenuItemBuilder::Build(data.custom_items[i])); | 57 params.custom_items.push_back(MenuItemBuilder::Build(data.custom_items[i])); |
| 57 | 58 |
| 58 if (!data.frame_history_item.IsNull()) { | 59 if (!data.frame_history_item.IsNull()) { |
| 59 params.frame_page_state = | 60 params.frame_page_state = |
| 60 SingleHistoryItemToPageState(data.frame_history_item); | 61 SingleHistoryItemToPageState(data.frame_history_item); |
| 61 } | 62 } |
| 62 | 63 |
| 63 params.link_text = data.link_text.Utf16(); | 64 params.link_text = data.link_text.Utf16(); |
| 64 | 65 |
| 65 return params; | 66 return params; |
| 66 } | 67 } |
| 67 | 68 |
| 68 } // namespace content | 69 } // namespace content |
| OLD | NEW |