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

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: Rebase Created 3 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 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 0cd3bf9b9be90ea1f21d07aa95d40c41559bd253..6d4902908af89f672e369c1c19b0f8251e77c33a 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
@@ -125,19 +125,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();
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