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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 1948343002: [reland] Browser Side Text Input State Tracking for OOPIF (Aura Only) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing sky@ comments Created 4 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
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/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 #include <utility> 10 #include <utility>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 #include "content/browser/media/media_web_contents_observer.h" 58 #include "content/browser/media/media_web_contents_observer.h"
59 #include "content/browser/media/session/media_session.h" 59 #include "content/browser/media/session/media_session.h"
60 #include "content/browser/message_port_message_filter.h" 60 #include "content/browser/message_port_message_filter.h"
61 #include "content/browser/plugin_content_origin_whitelist.h" 61 #include "content/browser/plugin_content_origin_whitelist.h"
62 #include "content/browser/renderer_host/render_process_host_impl.h" 62 #include "content/browser/renderer_host/render_process_host_impl.h"
63 #include "content/browser/renderer_host/render_view_host_delegate_view.h" 63 #include "content/browser/renderer_host/render_view_host_delegate_view.h"
64 #include "content/browser/renderer_host/render_view_host_impl.h" 64 #include "content/browser/renderer_host/render_view_host_impl.h"
65 #include "content/browser/renderer_host/render_widget_host_impl.h" 65 #include "content/browser/renderer_host/render_widget_host_impl.h"
66 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" 66 #include "content/browser/renderer_host/render_widget_host_input_event_router.h"
67 #include "content/browser/renderer_host/render_widget_host_view_base.h" 67 #include "content/browser/renderer_host/render_widget_host_view_base.h"
68 #include "content/browser/renderer_host/text_input_manager.h"
68 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_ impl.h" 69 #include "content/browser/screen_orientation/screen_orientation_dispatcher_host_ impl.h"
69 #include "content/browser/site_instance_impl.h" 70 #include "content/browser/site_instance_impl.h"
70 #include "content/browser/wake_lock/wake_lock_service_context.h" 71 #include "content/browser/wake_lock/wake_lock_service_context.h"
71 #include "content/browser/web_contents/web_contents_view_child_frame.h" 72 #include "content/browser/web_contents/web_contents_view_child_frame.h"
72 #include "content/browser/web_contents/web_contents_view_guest.h" 73 #include "content/browser/web_contents/web_contents_view_guest.h"
73 #include "content/browser/webui/generic_handler.h" 74 #include "content/browser/webui/generic_handler.h"
74 #include "content/browser/webui/web_ui_controller_factory_registry.h" 75 #include "content/browser/webui/web_ui_controller_factory_registry.h"
75 #include "content/browser/webui/web_ui_impl.h" 76 #include "content/browser/webui/web_ui_impl.h"
76 #include "content/common/browser_plugin/browser_plugin_constants.h" 77 #include "content/common/browser_plugin/browser_plugin_constants.h"
77 #include "content/common/browser_plugin/browser_plugin_messages.h" 78 #include "content/common/browser_plugin/browser_plugin_messages.h"
(...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after
1406 render_manager->CreateOuterDelegateProxy( 1407 render_manager->CreateOuterDelegateProxy(
1407 outer_contents_frame->GetSiteInstance(), 1408 outer_contents_frame->GetSiteInstance(),
1408 static_cast<RenderFrameHostImpl*>(outer_contents_frame)); 1409 static_cast<RenderFrameHostImpl*>(outer_contents_frame));
1409 1410
1410 render_manager->SetRWHViewForInnerContents( 1411 render_manager->SetRWHViewForInnerContents(
1411 render_manager->GetRenderWidgetHostView()); 1412 render_manager->GetRenderWidgetHostView());
1412 1413
1413 static_cast<RenderWidgetHostViewChildFrame*>( 1414 static_cast<RenderWidgetHostViewChildFrame*>(
1414 render_manager->GetRenderWidgetHostView()) 1415 render_manager->GetRenderWidgetHostView())
1415 ->RegisterSurfaceNamespaceId(); 1416 ->RegisterSurfaceNamespaceId();
1417
1418 // At this point, we should destroy the TextInputManager which will notify all
1419 // the RWHV in this WebContents. The RWHV in this WebContents should use the
1420 // TextInputManager owned by the outer WebContents.
1421 // TODO(ekaramad): Is it possible to have TextInputState before attaching to
1422 // outer WebContents? In such a case, is this still the right way to hand off
1423 // state tracking from inner WebContents's TextInputManager to that of the
1424 // outer WebContent (crbug.com/609846)?
1425 text_input_manager_.reset(nullptr);
1416 } 1426 }
1417 1427
1418 void WebContentsImpl::Stop() { 1428 void WebContentsImpl::Stop() {
1419 for (FrameTreeNode* node : frame_tree_.Nodes()) 1429 for (FrameTreeNode* node : frame_tree_.Nodes())
1420 node->StopLoading(); 1430 node->StopLoading();
1421 FOR_EACH_OBSERVER(WebContentsObserver, observers_, NavigationStopped()); 1431 FOR_EACH_OBSERVER(WebContentsObserver, observers_, NavigationStopped());
1422 } 1432 }
1423 1433
1424 WebContents* WebContentsImpl::Clone() { 1434 WebContents* WebContentsImpl::Clone() {
1425 // We use our current SiteInstance since the cloned entry will use it anyway. 1435 // We use our current SiteInstance since the cloned entry will use it anyway.
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
2378 if (browser_plugin_embedder_) 2388 if (browser_plugin_embedder_)
2379 browser_plugin_embedder_->DidSendScreenRects(); 2389 browser_plugin_embedder_->DidSendScreenRects();
2380 } 2390 }
2381 2391
2382 void WebContentsImpl::OnFirstPaintAfterLoad( 2392 void WebContentsImpl::OnFirstPaintAfterLoad(
2383 RenderWidgetHostImpl* render_widget_host) { 2393 RenderWidgetHostImpl* render_widget_host) {
2384 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 2394 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2385 DidFirstPaintAfterLoad(render_widget_host)); 2395 DidFirstPaintAfterLoad(render_widget_host));
2386 } 2396 }
2387 2397
2398 TextInputManager* WebContentsImpl::GetTextInputManager() {
2399 if (GetOuterWebContents())
2400 return GetOuterWebContents()->GetTextInputManager();
2401
2402 if (!text_input_manager_)
2403 text_input_manager_.reset(new TextInputManager());
2404
2405 return text_input_manager_.get();
2406 }
2407
2388 BrowserAccessibilityManager* 2408 BrowserAccessibilityManager*
2389 WebContentsImpl::GetRootBrowserAccessibilityManager() { 2409 WebContentsImpl::GetRootBrowserAccessibilityManager() {
2390 RenderFrameHostImpl* rfh = GetMainFrame(); 2410 RenderFrameHostImpl* rfh = GetMainFrame();
2391 return rfh ? rfh->browser_accessibility_manager() : nullptr; 2411 return rfh ? rfh->browser_accessibility_manager() : nullptr;
2392 } 2412 }
2393 2413
2394 BrowserAccessibilityManager* 2414 BrowserAccessibilityManager*
2395 WebContentsImpl::GetOrCreateRootBrowserAccessibilityManager() { 2415 WebContentsImpl::GetOrCreateRootBrowserAccessibilityManager() {
2396 RenderFrameHostImpl* rfh = GetMainFrame(); 2416 RenderFrameHostImpl* rfh = GetMainFrame();
2397 return rfh ? rfh->GetOrCreateBrowserAccessibilityManager() : nullptr; 2417 return rfh ? rfh->GetOrCreateBrowserAccessibilityManager() : nullptr;
(...skipping 2672 matching lines...) Expand 10 before | Expand all | Expand 10 after
5070 for (RenderViewHost* render_view_host : render_view_host_set) 5090 for (RenderViewHost* render_view_host : render_view_host_set)
5071 render_view_host->OnWebkitPreferencesChanged(); 5091 render_view_host->OnWebkitPreferencesChanged();
5072 } 5092 }
5073 5093
5074 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( 5094 void WebContentsImpl::SetJavaScriptDialogManagerForTesting(
5075 JavaScriptDialogManager* dialog_manager) { 5095 JavaScriptDialogManager* dialog_manager) {
5076 dialog_manager_ = dialog_manager; 5096 dialog_manager_ = dialog_manager;
5077 } 5097 }
5078 5098
5079 } // namespace content 5099 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698