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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_event_handler.cc

Issue 2912473002: Fix an IME bug where RWHImpl::ImeFinishCompositingText is called twice in a row (Closed)
Patch Set: Change EXPECT_EQ => ASSERT_EQ Created 3 years, 6 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/browser/renderer_host/render_widget_host_view_aura_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/browser/renderer_host/render_widget_host_view_event_handler.h" 5 #include "content/browser/renderer_host/render_widget_host_view_event_handler.h"
6 6
7 #include "base/metrics/user_metrics.h" 7 #include "base/metrics/user_metrics.h"
8 #include "base/metrics/user_metrics_action.h" 8 #include "base/metrics/user_metrics_action.h"
9 #include "content/browser/renderer_host/input/touch_selection_controller_client_ aura.h" 9 #include "content/browser/renderer_host/input/touch_selection_controller_client_ aura.h"
10 #include "content/browser/renderer_host/overscroll_controller.h" 10 #include "content/browser/renderer_host/overscroll_controller.h"
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 return (event->flags() & kAllowedButtons) != 0; 619 return (event->flags() & kAllowedButtons) != 0;
620 } 620 }
621 default: 621 default:
622 break; 622 break;
623 } 623 }
624 #endif 624 #endif
625 return true; 625 return true;
626 } 626 }
627 627
628 void RenderWidgetHostViewEventHandler::FinishImeCompositionSession() { 628 void RenderWidgetHostViewEventHandler::FinishImeCompositionSession() {
629 if (!host_view_->GetTextInputClient()->HasCompositionText()) 629 // RenderWidgetHostViewAura keeps track of existing composition texts. The
630 return; 630 // call to finish composition text should be made through the RWHVA itself
631 631 // otherwise the following call to cancel composition will lead to an extra
632 TextInputManager* text_input_manager = host_view_->GetTextInputManager(); 632 // IPC for finishing the ongoing composition (see https://crbug.com/723024).
633 if (!!text_input_manager && !!text_input_manager->GetActiveWidget()) 633 host_view_->GetTextInputClient()->ConfirmCompositionText();
634 text_input_manager->GetActiveWidget()->ImeFinishComposingText(false);
635 host_view_->ImeCancelComposition(); 634 host_view_->ImeCancelComposition();
636 } 635 }
637 636
638 void RenderWidgetHostViewEventHandler::ForwardMouseEventToParent( 637 void RenderWidgetHostViewEventHandler::ForwardMouseEventToParent(
639 ui::MouseEvent* event) { 638 ui::MouseEvent* event) {
640 // Needed to propagate mouse event to |window_->parent()->delegate()|, but 639 // Needed to propagate mouse event to |window_->parent()->delegate()|, but
641 // note that it might be something other than a WebContentsViewAura instance. 640 // note that it might be something other than a WebContentsViewAura instance.
642 // TODO(pkotwicz): Find a better way of doing this. 641 // TODO(pkotwicz): Find a better way of doing this.
643 // In fullscreen mode which is typically used by flash, don't forward 642 // In fullscreen mode which is typically used by flash, don't forward
644 // the mouse events to the parent. The renderer and the plugin process 643 // the mouse events to the parent. The renderer and the plugin process
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
953 bool non_zero_delta = 952 bool non_zero_delta =
954 mouse_wheel_event.delta_x || mouse_wheel_event.delta_y; 953 mouse_wheel_event.delta_x || mouse_wheel_event.delta_y;
955 mouse_wheel_event.phase = non_zero_delta 954 mouse_wheel_event.phase = non_zero_delta
956 ? blink::WebMouseWheelEvent::kPhaseChanged 955 ? blink::WebMouseWheelEvent::kPhaseChanged
957 : blink::WebMouseWheelEvent::kPhaseStationary; 956 : blink::WebMouseWheelEvent::kPhaseStationary;
958 mouse_wheel_end_dispatch_timer_.Reset(); 957 mouse_wheel_end_dispatch_timer_.Reset();
959 } 958 }
960 } 959 }
961 960
962 } // namespace content 961 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698