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

Unified Diff: content/browser/renderer_host/input/touch_selection_controller_client_child_frame.cc

Issue 2910223003: [refactor] - Rename and Move WebWidget::CaretOrSelectionRange to WebInputMethodController::GetSelec… (Closed)
Patch Set: Fixed some comments Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/renderer/input/frame_input_handler_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/input/touch_selection_controller_client_child_frame.cc
diff --git a/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.cc b/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.cc
index 5a40845ad3bb6352d397bec2e5122412ae2b9c6b..7a1325b0f4ffbf3fafd5ce3b05cc3f5cedb2e3e3 100644
--- a/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.cc
+++ b/content/browser/renderer_host/input/touch_selection_controller_client_child_frame.cc
@@ -124,19 +124,10 @@ bool TouchSelectionControllerClientChildFrame::IsCommandIdEnabled(
int command_id) const {
bool editable = rwhv_->GetTextInputType() != ui::TEXT_INPUT_TYPE_NONE;
bool readable = rwhv_->GetTextInputType() != ui::TEXT_INPUT_TYPE_PASSWORD;
- // TODO(wjmaclean): The test for has_selection should be changed to
- //
- // rwhv_->GetSelectionRange(&selection_range);
- // bool has_selection = !selection_range.is_empty();
- //
- // like in TouchSelectionControllerClientAura. Unfortunately this fails here
- // due to https://crbug.com/723790, which means that the first text
- // selected in an oopif subframe when it acquires focus will fail to send
- // a FrameHostMsg_SelectionChanged, meaning the TextInputManager won't
- // know about the new selection.
- bool has_selection = selection_start_.type() != gfx::SelectionBound::EMPTY &&
- selection_end_.type() != gfx::SelectionBound::EMPTY &&
- selection_start_ != selection_end_;
+
+ gfx::Range selection_range;
+ bool has_selection =
+ rwhv_->GetSelectionRange(&selection_range) && !selection_range.is_empty();
dcheng 2017/06/20 09:05:47 Can you help me understand what the difference bet
EhsanK 2017/07/10 15:38:29 They come from two different IPCs. * |selection
wjmaclean 2017/07/10 18:36:07 If you compare the pre- vs. post-patch code here,
switch (command_id) {
case IDS_APP_CUT:
return editable && readable && has_selection;
« no previous file with comments | « no previous file | content/renderer/input/frame_input_handler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698