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

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: Rebase (Code changed during CQ Dry-run) 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
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/content_browser.gypi » ('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 (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 1330 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 render_manager->CreateOuterDelegateProxy( 1409 render_manager->CreateOuterDelegateProxy(
1409 outer_contents_frame->GetSiteInstance(), 1410 outer_contents_frame->GetSiteInstance(),
1410 static_cast<RenderFrameHostImpl*>(outer_contents_frame)); 1411 static_cast<RenderFrameHostImpl*>(outer_contents_frame));
1411 1412
1412 render_manager->SetRWHViewForInnerContents( 1413 render_manager->SetRWHViewForInnerContents(
1413 render_manager->GetRenderWidgetHostView()); 1414 render_manager->GetRenderWidgetHostView());
1414 1415
1415 static_cast<RenderWidgetHostViewChildFrame*>( 1416 static_cast<RenderWidgetHostViewChildFrame*>(
1416 render_manager->GetRenderWidgetHostView()) 1417 render_manager->GetRenderWidgetHostView())
1417 ->RegisterSurfaceNamespaceId(); 1418 ->RegisterSurfaceNamespaceId();
1419
1420 // At this point, we should destroy the TextInputManager which will notify all
1421 // the RWHV in this WebContents. The RWHV in this WebContents should use the
1422 // TextInputManager owned by the outer WebContents.
1423 // TODO(ekaramad): Is it possible to have TextInputState before attaching to
1424 // outer WebContents? In such a case, is this still the right way to hand off
1425 // state tracking from inner WebContents's TextInputManager to that of the
1426 // outer WebContent (crbug.com/609846)?
1427 text_input_manager_.reset(nullptr);
1418 } 1428 }
1419 1429
1420 void WebContentsImpl::Stop() { 1430 void WebContentsImpl::Stop() {
1421 for (FrameTreeNode* node : frame_tree_.Nodes()) 1431 for (FrameTreeNode* node : frame_tree_.Nodes())
1422 node->StopLoading(); 1432 node->StopLoading();
1423 FOR_EACH_OBSERVER(WebContentsObserver, observers_, NavigationStopped()); 1433 FOR_EACH_OBSERVER(WebContentsObserver, observers_, NavigationStopped());
1424 } 1434 }
1425 1435
1426 WebContents* WebContentsImpl::Clone() { 1436 WebContents* WebContentsImpl::Clone() {
1427 // We use our current SiteInstance since the cloned entry will use it anyway. 1437 // We use our current SiteInstance since the cloned entry will use it anyway.
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after
2374 if (browser_plugin_embedder_) 2384 if (browser_plugin_embedder_)
2375 browser_plugin_embedder_->DidSendScreenRects(); 2385 browser_plugin_embedder_->DidSendScreenRects();
2376 } 2386 }
2377 2387
2378 void WebContentsImpl::OnFirstPaintAfterLoad( 2388 void WebContentsImpl::OnFirstPaintAfterLoad(
2379 RenderWidgetHostImpl* render_widget_host) { 2389 RenderWidgetHostImpl* render_widget_host) {
2380 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 2390 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
2381 DidFirstPaintAfterLoad(render_widget_host)); 2391 DidFirstPaintAfterLoad(render_widget_host));
2382 } 2392 }
2383 2393
2394 TextInputManager* WebContentsImpl::GetTextInputManager() {
2395 if (GetOuterWebContents())
2396 return GetOuterWebContents()->GetTextInputManager();
2397
2398 if (!text_input_manager_)
2399 text_input_manager_.reset(new TextInputManager());
2400
2401 return text_input_manager_.get();
2402 }
2403
2384 BrowserAccessibilityManager* 2404 BrowserAccessibilityManager*
2385 WebContentsImpl::GetRootBrowserAccessibilityManager() { 2405 WebContentsImpl::GetRootBrowserAccessibilityManager() {
2386 RenderFrameHostImpl* rfh = GetMainFrame(); 2406 RenderFrameHostImpl* rfh = GetMainFrame();
2387 return rfh ? rfh->browser_accessibility_manager() : nullptr; 2407 return rfh ? rfh->browser_accessibility_manager() : nullptr;
2388 } 2408 }
2389 2409
2390 BrowserAccessibilityManager* 2410 BrowserAccessibilityManager*
2391 WebContentsImpl::GetOrCreateRootBrowserAccessibilityManager() { 2411 WebContentsImpl::GetOrCreateRootBrowserAccessibilityManager() {
2392 RenderFrameHostImpl* rfh = GetMainFrame(); 2412 RenderFrameHostImpl* rfh = GetMainFrame();
2393 return rfh ? rfh->GetOrCreateBrowserAccessibilityManager() : nullptr; 2413 return rfh ? rfh->GetOrCreateBrowserAccessibilityManager() : nullptr;
(...skipping 2691 matching lines...) Expand 10 before | Expand all | Expand 10 after
5085 for (RenderViewHost* render_view_host : render_view_host_set) 5105 for (RenderViewHost* render_view_host : render_view_host_set)
5086 render_view_host->OnWebkitPreferencesChanged(); 5106 render_view_host->OnWebkitPreferencesChanged();
5087 } 5107 }
5088 5108
5089 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( 5109 void WebContentsImpl::SetJavaScriptDialogManagerForTesting(
5090 JavaScriptDialogManager* dialog_manager) { 5110 JavaScriptDialogManager* dialog_manager) {
5091 dialog_manager_ = dialog_manager; 5111 dialog_manager_ = dialog_manager;
5092 } 5112 }
5093 5113
5094 } // namespace content 5114 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698