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

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: Using the Destruction Observer for RWHVAura Created 4 years, 7 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 2278 matching lines...) Expand 10 before | Expand all | Expand 10 after
2356 static_cast<RenderWidgetHostViewBase*>(GetRenderWidgetHostView()); 2357 static_cast<RenderWidgetHostViewBase*>(GetRenderWidgetHostView());
2357 if (rwhv) { 2358 if (rwhv) {
2358 SendPageMessage(new PageMsg_UpdateWindowScreenRect( 2359 SendPageMessage(new PageMsg_UpdateWindowScreenRect(
2359 MSG_ROUTING_NONE, rwhv->GetBoundsInRootWindow())); 2360 MSG_ROUTING_NONE, rwhv->GetBoundsInRootWindow()));
2360 } 2361 }
2361 2362
2362 if (browser_plugin_embedder_) 2363 if (browser_plugin_embedder_)
2363 browser_plugin_embedder_->DidSendScreenRects(); 2364 browser_plugin_embedder_->DidSendScreenRects();
2364 } 2365 }
2365 2366
2367 TextInputManager* WebContentsImpl::GetTextInputManager() {
2368 if (GetOuterWebContents()) {
2369 if (text_input_manager_) {
2370 // Since the outer WebContents exists, we should destroy
2371 // |text_input_manager_| which will in turn notify all the
2372 // RenderWidgetHostViews.
2373 // TODO(ekaramad): Is this the right way to for IME handoff?
2374 // (crbug.com/609846).
2375 text_input_manager_.reset(nullptr);
2376 }
2377 return GetOuterWebContents()->GetTextInputManager();
2378 }
2379
2380 if (!text_input_manager_)
2381 text_input_manager_.reset(new TextInputManager());
2382
2383 return text_input_manager_.get();
2384 }
2385
2366 BrowserAccessibilityManager* 2386 BrowserAccessibilityManager*
2367 WebContentsImpl::GetRootBrowserAccessibilityManager() { 2387 WebContentsImpl::GetRootBrowserAccessibilityManager() {
2368 RenderFrameHostImpl* rfh = GetMainFrame(); 2388 RenderFrameHostImpl* rfh = GetMainFrame();
2369 return rfh ? rfh->browser_accessibility_manager() : nullptr; 2389 return rfh ? rfh->browser_accessibility_manager() : nullptr;
2370 } 2390 }
2371 2391
2372 BrowserAccessibilityManager* 2392 BrowserAccessibilityManager*
2373 WebContentsImpl::GetOrCreateRootBrowserAccessibilityManager() { 2393 WebContentsImpl::GetOrCreateRootBrowserAccessibilityManager() {
2374 RenderFrameHostImpl* rfh = GetMainFrame(); 2394 RenderFrameHostImpl* rfh = GetMainFrame();
2375 return rfh ? rfh->GetOrCreateBrowserAccessibilityManager() : nullptr; 2395 return rfh ? rfh->GetOrCreateBrowserAccessibilityManager() : nullptr;
(...skipping 2644 matching lines...) Expand 10 before | Expand all | Expand 10 after
5020 for (RenderViewHost* render_view_host : render_view_host_set) 5040 for (RenderViewHost* render_view_host : render_view_host_set)
5021 render_view_host->OnWebkitPreferencesChanged(); 5041 render_view_host->OnWebkitPreferencesChanged();
5022 } 5042 }
5023 5043
5024 void WebContentsImpl::SetJavaScriptDialogManagerForTesting( 5044 void WebContentsImpl::SetJavaScriptDialogManagerForTesting(
5025 JavaScriptDialogManager* dialog_manager) { 5045 JavaScriptDialogManager* dialog_manager) {
5026 dialog_manager_ = dialog_manager; 5046 dialog_manager_ = dialog_manager;
5027 } 5047 }
5028 5048
5029 } // namespace content 5049 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698