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

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

Issue 2149493004: [refactor] Removing the dead method RenderWidgetHostView::GetSelectedText() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Call method on correct view Created 4 years, 5 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 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/renderer_host/render_widget_host_impl.h" 9 #include "content/browser/renderer_host/render_widget_host_impl.h"
10 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 10 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 web_underlines.emplace_back(blink::WebCompositionUnderline( 244 web_underlines.emplace_back(blink::WebCompositionUnderline(
245 underline.start_offset, underline.end_offset, underline.color, 245 underline.start_offset, underline.end_offset, underline.color,
246 underline.thick, underline.background_color)); 246 underline.thick, underline.background_color));
247 } 247 }
248 248
249 static_cast<RenderWidgetHostImpl*>(render_widget_host) 249 static_cast<RenderWidgetHostImpl*>(render_widget_host)
250 ->ImeSetComposition(text, web_underlines, replacement_range, 250 ->ImeSetComposition(text, web_underlines, replacement_range,
251 selection_start, selection_end); 251 selection_start, selection_end);
252 } 252 }
253 253
254 base::string16 GetSelectedTextForRenderWidgetHostView(
255 RenderWidgetHostView* view) {
256 return static_cast<RenderWidgetHostViewBase*>(view)
257 ->GetSelectedTextForTesting();
258 }
259
254 size_t GetRegisteredViewsCountFromTextInputManager(WebContents* web_contents) { 260 size_t GetRegisteredViewsCountFromTextInputManager(WebContents* web_contents) {
255 std::unordered_set<RenderWidgetHostView*> views; 261 std::unordered_set<RenderWidgetHostView*> views;
256 TextInputManager* manager = 262 TextInputManager* manager =
257 static_cast<WebContentsImpl*>(web_contents)->GetTextInputManager(); 263 static_cast<WebContentsImpl*>(web_contents)->GetTextInputManager();
258 return !!manager ? manager->GetRegisteredViewsCountForTesting() : 0; 264 return !!manager ? manager->GetRegisteredViewsCountForTesting() : 0;
259 } 265 }
260 266
261 RenderWidgetHostView* GetActiveViewFromWebContents(WebContents* web_contents) { 267 RenderWidgetHostView* GetActiveViewFromWebContents(WebContents* web_contents) {
262 return static_cast<WebContentsImpl*>(web_contents) 268 return static_cast<WebContentsImpl*>(web_contents)
263 ->GetTextInputManager() 269 ->GetTextInputManager()
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 391
386 #ifdef USE_AURA 392 #ifdef USE_AURA
387 RenderWidgetHostViewAura* view = static_cast<RenderWidgetHostViewAura*>( 393 RenderWidgetHostViewAura* view = static_cast<RenderWidgetHostViewAura*>(
388 web_contents->GetRenderWidgetHostView()); 394 web_contents->GetRenderWidgetHostView());
389 observer.reset(new InputMethodObserverAura(view->GetInputMethod())); 395 observer.reset(new InputMethodObserverAura(view->GetInputMethod()));
390 #endif 396 #endif
391 return observer; 397 return observer;
392 } 398 }
393 399
394 } // namespace content 400 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698