| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "content/child/service_worker/web_service_worker_provider_impl.h" | 42 #include "content/child/service_worker/web_service_worker_provider_impl.h" |
| 43 #include "content/child/v8_value_converter_impl.h" | 43 #include "content/child/v8_value_converter_impl.h" |
| 44 #include "content/child/web_url_loader_impl.h" | 44 #include "content/child/web_url_loader_impl.h" |
| 45 #include "content/child/web_url_request_util.h" | 45 #include "content/child/web_url_request_util.h" |
| 46 #include "content/child/webmessageportchannel_impl.h" | 46 #include "content/child/webmessageportchannel_impl.h" |
| 47 #include "content/child/weburlresponse_extradata_impl.h" | 47 #include "content/child/weburlresponse_extradata_impl.h" |
| 48 #include "content/common/accessibility_messages.h" | 48 #include "content/common/accessibility_messages.h" |
| 49 #include "content/common/clipboard_messages.h" | 49 #include "content/common/clipboard_messages.h" |
| 50 #include "content/common/content_constants_internal.h" | 50 #include "content/common/content_constants_internal.h" |
| 51 #include "content/common/content_security_policy_header.h" | 51 #include "content/common/content_security_policy_header.h" |
| 52 #include "content/common/edit_command.h" |
| 52 #include "content/common/frame_messages.h" | 53 #include "content/common/frame_messages.h" |
| 53 #include "content/common/frame_owner_properties.h" | 54 #include "content/common/frame_owner_properties.h" |
| 54 #include "content/common/frame_replication_state.h" | 55 #include "content/common/frame_replication_state.h" |
| 55 #include "content/common/gpu/client/context_provider_command_buffer.h" | 56 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 56 #include "content/common/input_messages.h" | 57 #include "content/common/input_messages.h" |
| 57 #include "content/common/navigation_params.h" | 58 #include "content/common/navigation_params.h" |
| 58 #include "content/common/page_messages.h" | 59 #include "content/common/page_messages.h" |
| 59 #include "content/common/savable_subframe.h" | 60 #include "content/common/savable_subframe.h" |
| 60 #include "content/common/service_worker/service_worker_types.h" | 61 #include "content/common/service_worker/service_worker_types.h" |
| 61 #include "content/common/site_isolation_policy.h" | 62 #include "content/common/site_isolation_policy.h" |
| (...skipping 3705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3767 // UpdateTextInputState should be called before SyncSelectionIfRequired. | 3768 // UpdateTextInputState should be called before SyncSelectionIfRequired. |
| 3768 // UpdateTextInputState may send TextInputStateChanged to notify the focus | 3769 // UpdateTextInputState may send TextInputStateChanged to notify the focus |
| 3769 // was changed, and SyncSelectionIfRequired may send SelectionChanged | 3770 // was changed, and SyncSelectionIfRequired may send SelectionChanged |
| 3770 // to notify the selection was changed. Focus change should be notified | 3771 // to notify the selection was changed. Focus change should be notified |
| 3771 // before selection change. | 3772 // before selection change. |
| 3772 GetRenderWidget()->UpdateTextInputState(ShowIme::HIDE_IME, | 3773 GetRenderWidget()->UpdateTextInputState(ShowIme::HIDE_IME, |
| 3773 ChangeSource::FROM_NON_IME); | 3774 ChangeSource::FROM_NON_IME); |
| 3774 SyncSelectionIfRequired(); | 3775 SyncSelectionIfRequired(); |
| 3775 } | 3776 } |
| 3776 | 3777 |
| 3778 bool RenderFrameImpl::handleCurrentKeyboardEvent() { |
| 3779 bool did_execute_command = false; |
| 3780 for (auto command : GetRenderWidget()->edit_commands()) { |
| 3781 // In gtk and cocoa, it's possible to bind multiple edit commands to one |
| 3782 // key (but it's the exception). Once one edit command is not executed, it |
| 3783 // seems safest to not execute the rest. |
| 3784 if (!frame_->executeCommand(blink::WebString::fromUTF8(command.name), |
| 3785 blink::WebString::fromUTF8(command.value))) |
| 3786 break; |
| 3787 did_execute_command = true; |
| 3788 } |
| 3789 |
| 3790 return did_execute_command; |
| 3791 } |
| 3792 |
| 3777 blink::WebColorChooser* RenderFrameImpl::createColorChooser( | 3793 blink::WebColorChooser* RenderFrameImpl::createColorChooser( |
| 3778 blink::WebColorChooserClient* client, | 3794 blink::WebColorChooserClient* client, |
| 3779 const blink::WebColor& initial_color, | 3795 const blink::WebColor& initial_color, |
| 3780 const blink::WebVector<blink::WebColorSuggestion>& suggestions) { | 3796 const blink::WebVector<blink::WebColorSuggestion>& suggestions) { |
| 3781 RendererWebColorChooserImpl* color_chooser = | 3797 RendererWebColorChooserImpl* color_chooser = |
| 3782 new RendererWebColorChooserImpl(this, client); | 3798 new RendererWebColorChooserImpl(this, client); |
| 3783 std::vector<ColorSuggestion> color_suggestions; | 3799 std::vector<ColorSuggestion> color_suggestions; |
| 3784 for (size_t i = 0; i < suggestions.size(); i++) { | 3800 for (size_t i = 0; i < suggestions.size(); i++) { |
| 3785 color_suggestions.push_back(ColorSuggestion(suggestions[i])); | 3801 color_suggestions.push_back(ColorSuggestion(suggestions[i])); |
| 3786 } | 3802 } |
| (...skipping 2536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6323 // event target. Potentially a Pepper plugin will receive the event. | 6339 // event target. Potentially a Pepper plugin will receive the event. |
| 6324 // In order to tell whether a plugin gets the last mouse event and which it | 6340 // In order to tell whether a plugin gets the last mouse event and which it |
| 6325 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6341 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6326 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6342 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6327 // |pepper_last_mouse_event_target_|. | 6343 // |pepper_last_mouse_event_target_|. |
| 6328 pepper_last_mouse_event_target_ = nullptr; | 6344 pepper_last_mouse_event_target_ = nullptr; |
| 6329 #endif | 6345 #endif |
| 6330 } | 6346 } |
| 6331 | 6347 |
| 6332 } // namespace content | 6348 } // namespace content |
| OLD | NEW |