Chromium Code Reviews| 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; |