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

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

Issue 1879453002: Reset Text Input State for RenderWidgetHostView before RenderWidgetHost Detaches from Delegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing lazyboy@ comment Created 4 years, 8 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/browser_plugin/browser_plugin_guest.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 (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 <utility> 10 #include <utility>
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" 50 #include "content/browser/renderer_host/render_widget_host_input_event_router.h"
51 #include "content/browser/renderer_host/render_widget_host_owner_delegate.h" 51 #include "content/browser/renderer_host/render_widget_host_owner_delegate.h"
52 #include "content/browser/renderer_host/render_widget_host_view_base.h" 52 #include "content/browser/renderer_host/render_widget_host_view_base.h"
53 #include "content/common/content_constants_internal.h" 53 #include "content/common/content_constants_internal.h"
54 #include "content/common/content_switches_internal.h" 54 #include "content/common/content_switches_internal.h"
55 #include "content/common/cursors/webcursor.h" 55 #include "content/common/cursors/webcursor.h"
56 #include "content/common/frame_messages.h" 56 #include "content/common/frame_messages.h"
57 #include "content/common/host_shared_bitmap_manager.h" 57 #include "content/common/host_shared_bitmap_manager.h"
58 #include "content/common/input_messages.h" 58 #include "content/common/input_messages.h"
59 #include "content/common/resize_params.h" 59 #include "content/common/resize_params.h"
60 #include "content/common/text_input_state.h"
60 #include "content/common/view_messages.h" 61 #include "content/common/view_messages.h"
61 #include "content/public/browser/native_web_keyboard_event.h" 62 #include "content/public/browser/native_web_keyboard_event.h"
62 #include "content/public/browser/notification_service.h" 63 #include "content/public/browser/notification_service.h"
63 #include "content/public/browser/notification_types.h" 64 #include "content/public/browser/notification_types.h"
64 #include "content/public/browser/render_widget_host_iterator.h" 65 #include "content/public/browser/render_widget_host_iterator.h"
65 #include "content/public/common/content_constants.h" 66 #include "content/public/common/content_constants.h"
66 #include "content/public/common/content_switches.h" 67 #include "content/public/common/content_switches.h"
67 #include "content/public/common/result_codes.h" 68 #include "content/public/common/result_codes.h"
68 #include "content/public/common/web_preferences.h" 69 #include "content/public/common/web_preferences.h"
69 #include "gpu/GLES2/gl2extchromium.h" 70 #include "gpu/GLES2/gl2extchromium.h"
(...skipping 1979 matching lines...) Expand 10 before | Expand all | Expand 10 after
2049 // DelayedAutoResized will not get called again). 2050 // DelayedAutoResized will not get called again).
2050 new_auto_size_.SetSize(0, 0); 2051 new_auto_size_.SetSize(0, 0);
2051 if (!auto_resize_enabled_) 2052 if (!auto_resize_enabled_)
2052 return; 2053 return;
2053 2054
2054 if (delegate_) 2055 if (delegate_)
2055 delegate_->ResizeDueToAutoResize(this, new_size); 2056 delegate_->ResizeDueToAutoResize(this, new_size);
2056 } 2057 }
2057 2058
2058 void RenderWidgetHostImpl::DetachDelegate() { 2059 void RenderWidgetHostImpl::DetachDelegate() {
2060 // If |view_| has active text input state, it will not be able to update the
2061 // |delegate_| about shut down and losing the state (see crbug.com/602144).
2062 if (view_)
2063 view_->TextInputStateChanged(TextInputState());
2064
2059 delegate_ = NULL; 2065 delegate_ = NULL;
2060 } 2066 }
2061 2067
2062 void RenderWidgetHostImpl::FrameSwapped(const ui::LatencyInfo& latency_info) { 2068 void RenderWidgetHostImpl::FrameSwapped(const ui::LatencyInfo& latency_info) {
2063 ui::LatencyInfo::LatencyComponent window_snapshot_component; 2069 ui::LatencyInfo::LatencyComponent window_snapshot_component;
2064 if (latency_info.FindLatency(ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT, 2070 if (latency_info.FindLatency(ui::WINDOW_SNAPSHOT_FRAME_NUMBER_COMPONENT,
2065 GetLatencyComponentId(), 2071 GetLatencyComponentId(),
2066 &window_snapshot_component)) { 2072 &window_snapshot_component)) {
2067 int sequence_number = static_cast<int>( 2073 int sequence_number = static_cast<int>(
2068 window_snapshot_component.sequence_number); 2074 window_snapshot_component.sequence_number);
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
2166 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL; 2172 return delegate_ ? delegate_->GetRootBrowserAccessibilityManager() : NULL;
2167 } 2173 }
2168 2174
2169 BrowserAccessibilityManager* 2175 BrowserAccessibilityManager*
2170 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() { 2176 RenderWidgetHostImpl::GetOrCreateRootBrowserAccessibilityManager() {
2171 return delegate_ ? 2177 return delegate_ ?
2172 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL; 2178 delegate_->GetOrCreateRootBrowserAccessibilityManager() : NULL;
2173 } 2179 }
2174 2180
2175 } // namespace content 2181 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/browser_plugin/browser_plugin_guest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698