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

Side by Side Diff: content/public/test/text_input_test_utils.cc

Issue 2623483003: Support tracking focused node element for OOPIFs. (Closed)
Patch Set: Added the missing forward declaration Created 3 years, 11 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/public/test/text_input_test_utils.h ('k') | content/renderer/render_frame_impl.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/public/test/text_input_test_utils.h" 5 #include "content/public/test/text_input_test_utils.h"
6 6
7 #include <unordered_set> 7 #include <unordered_set>
8 8
9 #include "content/browser/frame_host/render_frame_host_impl.h"
9 #include "content/browser/renderer_host/render_widget_host_impl.h" 10 #include "content/browser/renderer_host/render_widget_host_impl.h"
10 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 11 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
11 #include "content/browser/renderer_host/render_widget_host_view_base.h" 12 #include "content/browser/renderer_host/render_widget_host_view_base.h"
12 #include "content/browser/renderer_host/render_widget_host_view_base_observer.h" 13 #include "content/browser/renderer_host/render_widget_host_view_base_observer.h"
13 #include "content/browser/renderer_host/text_input_manager.h" 14 #include "content/browser/renderer_host/text_input_manager.h"
14 #include "content/browser/web_contents/web_contents_impl.h" 15 #include "content/browser/web_contents/web_contents_impl.h"
15 #include "content/common/input_messages.h" 16 #include "content/common/input_messages.h"
16 #include "content/common/text_input_state.h" 17 #include "content/common/text_input_state.h"
17 #include "content/common/view_messages.h" 18 #include "content/common/view_messages.h"
18 #include "content/public/browser/render_widget_host_view.h" 19 #include "content/public/browser/render_widget_host_view.h"
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 TextInputManager* manager = 250 TextInputManager* manager =
250 static_cast<WebContentsImpl*>(web_contents)->GetTextInputManager(); 251 static_cast<WebContentsImpl*>(web_contents)->GetTextInputManager();
251 if (!manager || !manager->GetActiveWidget()) 252 if (!manager || !manager->GetActiveWidget())
252 return false; 253 return false;
253 254
254 manager->GetActiveWidget()->Send(new InputMsg_RequestCompositionUpdate( 255 manager->GetActiveWidget()->Send(new InputMsg_RequestCompositionUpdate(
255 manager->GetActiveWidget()->GetRoutingID(), true, false)); 256 manager->GetActiveWidget()->GetRoutingID(), true, false));
256 return true; 257 return true;
257 } 258 }
258 259
260 bool DoesFrameHaveFocusedEditableElement(RenderFrameHost* frame) {
261 return static_cast<RenderFrameHostImpl*>(frame)
262 ->has_focused_editable_element();
263 }
264
259 size_t GetRegisteredViewsCountFromTextInputManager(WebContents* web_contents) { 265 size_t GetRegisteredViewsCountFromTextInputManager(WebContents* web_contents) {
260 std::unordered_set<RenderWidgetHostView*> views; 266 std::unordered_set<RenderWidgetHostView*> views;
261 TextInputManager* manager = 267 TextInputManager* manager =
262 static_cast<WebContentsImpl*>(web_contents)->GetTextInputManager(); 268 static_cast<WebContentsImpl*>(web_contents)->GetTextInputManager();
263 return !!manager ? manager->GetRegisteredViewsCountForTesting() : 0; 269 return !!manager ? manager->GetRegisteredViewsCountForTesting() : 0;
264 } 270 }
265 271
266 RenderWidgetHostView* GetActiveViewFromWebContents(WebContents* web_contents) { 272 RenderWidgetHostView* GetActiveViewFromWebContents(WebContents* web_contents) {
267 return static_cast<WebContentsImpl*>(web_contents) 273 return static_cast<WebContentsImpl*>(web_contents)
268 ->GetTextInputManager() 274 ->GetTextInputManager()
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 411
406 #ifdef USE_AURA 412 #ifdef USE_AURA
407 RenderWidgetHostViewAura* view = static_cast<RenderWidgetHostViewAura*>( 413 RenderWidgetHostViewAura* view = static_cast<RenderWidgetHostViewAura*>(
408 web_contents->GetRenderWidgetHostView()); 414 web_contents->GetRenderWidgetHostView());
409 observer.reset(new InputMethodObserverAura(view->GetInputMethod())); 415 observer.reset(new InputMethodObserverAura(view->GetInputMethod()));
410 #endif 416 #endif
411 return observer; 417 return observer;
412 } 418 }
413 419
414 } // namespace content 420 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/text_input_test_utils.h ('k') | content/renderer/render_frame_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698