Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1467)

Side by Side Diff: content/renderer/render_frame_impl.cc

Issue 2349523002: Add support for edit commands in OOPIFs. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 3718 matching lines...) Expand 10 before | Expand all | Expand 10 after
3780 // UpdateTextInputState should be called before SyncSelectionIfRequired. 3781 // UpdateTextInputState should be called before SyncSelectionIfRequired.
3781 // UpdateTextInputState may send TextInputStateChanged to notify the focus 3782 // UpdateTextInputState may send TextInputStateChanged to notify the focus
3782 // was changed, and SyncSelectionIfRequired may send SelectionChanged 3783 // was changed, and SyncSelectionIfRequired may send SelectionChanged
3783 // to notify the selection was changed. Focus change should be notified 3784 // to notify the selection was changed. Focus change should be notified
3784 // before selection change. 3785 // before selection change.
3785 GetRenderWidget()->UpdateTextInputState(ShowIme::HIDE_IME, 3786 GetRenderWidget()->UpdateTextInputState(ShowIme::HIDE_IME,
3786 ChangeSource::FROM_NON_IME); 3787 ChangeSource::FROM_NON_IME);
3787 SyncSelectionIfRequired(); 3788 SyncSelectionIfRequired();
3788 } 3789 }
3789 3790
3791 bool RenderFrameImpl::handleCurrentKeyboardEvent() {
3792 bool did_execute_command = false;
3793 for (auto command : GetRenderWidget()->edit_commands()) {
3794 // In gtk and cocoa, it's possible to bind multiple edit commands to one
3795 // key (but it's the exception). Once one edit command is not executed, it
3796 // seems safest to not execute the rest.
3797 if (!frame_->executeCommand(blink::WebString::fromUTF8(command.name),
3798 blink::WebString::fromUTF8(command.value)))
3799 break;
3800 did_execute_command = true;
3801 }
3802
3803 return did_execute_command;
3804 }
3805
3790 blink::WebColorChooser* RenderFrameImpl::createColorChooser( 3806 blink::WebColorChooser* RenderFrameImpl::createColorChooser(
3791 blink::WebColorChooserClient* client, 3807 blink::WebColorChooserClient* client,
3792 const blink::WebColor& initial_color, 3808 const blink::WebColor& initial_color,
3793 const blink::WebVector<blink::WebColorSuggestion>& suggestions) { 3809 const blink::WebVector<blink::WebColorSuggestion>& suggestions) {
3794 RendererWebColorChooserImpl* color_chooser = 3810 RendererWebColorChooserImpl* color_chooser =
3795 new RendererWebColorChooserImpl(this, client); 3811 new RendererWebColorChooserImpl(this, client);
3796 std::vector<ColorSuggestion> color_suggestions; 3812 std::vector<ColorSuggestion> color_suggestions;
3797 for (size_t i = 0; i < suggestions.size(); i++) { 3813 for (size_t i = 0; i < suggestions.size(); i++) {
3798 color_suggestions.push_back(ColorSuggestion(suggestions[i])); 3814 color_suggestions.push_back(ColorSuggestion(suggestions[i]));
3799 } 3815 }
(...skipping 2566 matching lines...) Expand 10 before | Expand all | Expand 10 after
6366 // event target. Potentially a Pepper plugin will receive the event. 6382 // event target. Potentially a Pepper plugin will receive the event.
6367 // In order to tell whether a plugin gets the last mouse event and which it 6383 // In order to tell whether a plugin gets the last mouse event and which it
6368 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets 6384 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets
6369 // the event, it will notify us via DidReceiveMouseEvent() and set itself as 6385 // the event, it will notify us via DidReceiveMouseEvent() and set itself as
6370 // |pepper_last_mouse_event_target_|. 6386 // |pepper_last_mouse_event_target_|.
6371 pepper_last_mouse_event_target_ = nullptr; 6387 pepper_last_mouse_event_target_ = nullptr;
6372 #endif 6388 #endif
6373 } 6389 }
6374 6390
6375 } // namespace content 6391 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | content/renderer/render_view_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698