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

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

Issue 2755723002: Fixed an IME bug due to a race in TextInputStateChanged
Patch Set: Using BrowserPlugingEmbedder for determinning focused guests Created 3 years, 9 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_impl.h" 5 #include "content/browser/renderer_host/render_widget_host_impl.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <set> 9 #include <set>
10 #include <tuple> 10 #include <tuple>
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "content/browser/renderer_host/input/timeout_monitor.h" 45 #include "content/browser/renderer_host/input/timeout_monitor.h"
46 #include "content/browser/renderer_host/input/touch_emulator.h" 46 #include "content/browser/renderer_host/input/touch_emulator.h"
47 #include "content/browser/renderer_host/render_process_host_impl.h" 47 #include "content/browser/renderer_host/render_process_host_impl.h"
48 #include "content/browser/renderer_host/render_view_host_delegate.h" 48 #include "content/browser/renderer_host/render_view_host_delegate.h"
49 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 49 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
50 #include "content/browser/renderer_host/render_view_host_impl.h" 50 #include "content/browser/renderer_host/render_view_host_impl.h"
51 #include "content/browser/renderer_host/render_widget_helper.h" 51 #include "content/browser/renderer_host/render_widget_helper.h"
52 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" 52 #include "content/browser/renderer_host/render_widget_host_input_event_router.h"
53 #include "content/browser/renderer_host/render_widget_host_owner_delegate.h" 53 #include "content/browser/renderer_host/render_widget_host_owner_delegate.h"
54 #include "content/browser/renderer_host/render_widget_host_view_base.h" 54 #include "content/browser/renderer_host/render_widget_host_view_base.h"
55 #include "content/browser/renderer_host/text_input_manager.h"
55 #include "content/browser/service_worker/service_worker_context_wrapper.h" 56 #include "content/browser/service_worker/service_worker_context_wrapper.h"
56 #include "content/common/content_constants_internal.h" 57 #include "content/common/content_constants_internal.h"
57 #include "content/common/content_switches_internal.h" 58 #include "content/common/content_switches_internal.h"
58 #include "content/common/cursors/webcursor.h" 59 #include "content/common/cursors/webcursor.h"
59 #include "content/common/drag_messages.h" 60 #include "content/common/drag_messages.h"
60 #include "content/common/frame_messages.h" 61 #include "content/common/frame_messages.h"
61 #include "content/common/host_shared_bitmap_manager.h" 62 #include "content/common/host_shared_bitmap_manager.h"
62 #include "content/common/input_messages.h" 63 #include "content/common/input_messages.h"
63 #include "content/common/resize_params.h" 64 #include "content/common/resize_params.h"
64 #include "content/common/text_input_state.h" 65 #include "content/common/text_input_state.h"
(...skipping 1969 matching lines...) Expand 10 before | Expand all | Expand 10 after
2034 } 2035 }
2035 touch_emulator_->Enable(config_type); 2036 touch_emulator_->Enable(config_type);
2036 } else { 2037 } else {
2037 if (touch_emulator_) 2038 if (touch_emulator_)
2038 touch_emulator_->Disable(); 2039 touch_emulator_->Disable();
2039 } 2040 }
2040 } 2041 }
2041 2042
2042 void RenderWidgetHostImpl::OnTextInputStateChanged( 2043 void RenderWidgetHostImpl::OnTextInputStateChanged(
2043 const TextInputState& params) { 2044 const TextInputState& params) {
2045 // TODO(ekaramad): Remove this with BrowserPlugin (https://crbug.com/533069).
2046 if (delegate_ && delegate_->GetTextInputManager() &&
2047 delegate_->GetTextInputManager()->GetTextInputState() &&
2048 delegate_->GetTextInputManager()->GetTextInputState()->type !=
2049 ui::TEXT_INPUT_TYPE_NONE &&
2050 delegate_->HasFocusedGuests()) {
2051 // There is a focused BrowserPlugin-based guest on the page, therefore do
2052 // not forward any update to the |view_|. We reach here because focus has
2053 // recently been passed on BrowserPlugin but at the same time, RenderWidget
2054 // needed to update TextInputState (e.g., an <input> blurred before the
2055 // plugin received focus). Since there is no guarantee on the order of the
2056 // update IPCs received from the guest process and the embedder process,
2057 // this update may be overwriting the correct update from the guest (
2058 // https://crbug.com/546645).
2059 return;
2060 }
2061
2044 if (view_) 2062 if (view_)
2045 view_->TextInputStateChanged(params); 2063 view_->TextInputStateChanged(params);
2046 } 2064 }
2047 2065
2048 void RenderWidgetHostImpl::OnImeCompositionRangeChanged( 2066 void RenderWidgetHostImpl::OnImeCompositionRangeChanged(
2049 const gfx::Range& range, 2067 const gfx::Range& range,
2050 const std::vector<gfx::Rect>& character_bounds) { 2068 const std::vector<gfx::Rect>& character_bounds) {
2051 if (view_) 2069 if (view_)
2052 view_->ImeCompositionRangeChanged(range, character_bounds); 2070 view_->ImeCompositionRangeChanged(range, character_bounds);
2053 } 2071 }
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
2615 // different from the receiver's. 2633 // different from the receiver's.
2616 file_system_file.url = 2634 file_system_file.url =
2617 GURL(storage::GetIsolatedFileSystemRootURIString( 2635 GURL(storage::GetIsolatedFileSystemRootURIString(
2618 file_system_url.origin(), filesystem_id, std::string()) 2636 file_system_url.origin(), filesystem_id, std::string())
2619 .append(register_name)); 2637 .append(register_name));
2620 file_system_file.filesystem_id = filesystem_id; 2638 file_system_file.filesystem_id = filesystem_id;
2621 } 2639 }
2622 } 2640 }
2623 2641
2624 } // namespace content 2642 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_delegate.cc ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698