Commit 45236331 authored by Ted Choc's avatar Ted Choc Committed by Commit Bot

Add clarifying comment in UrlBar.java for copy/cut handling.

BUG=

Change-Id: I5372417f961594c3907ebde5f38a1512c83f189d
Reviewed-on: https://chromium-review.googlesource.com/903182Reviewed-by: default avatarMaria Khomenko <mariakhomenko@chromium.org>
Commit-Queue: Maria Khomenko <mariakhomenko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534837}
parent d742024d
...@@ -585,6 +585,20 @@ public class UrlBar extends AutocompleteEditText { ...@@ -585,6 +585,20 @@ public class UrlBar extends AutocompleteEditText {
// If we are copying/cutting the full previously formatted URL, reset the URL // If we are copying/cutting the full previously formatted URL, reset the URL
// text before initiating the TextViews handling of the context menu. // text before initiating the TextViews handling of the context menu.
//
// Example:
// Original display text: www.example.com
// Original URL: http://www.example.com
//
// Editing State:
// www.example.com/blah/foo
// |<--- Selection --->|
//
// Resulting clipboard text should be:
// http://www.example.com/blah/
//
// As long as the full original text was selected, it will replace that with the original
// URL and keep any further modifications by the user.
String currentText = getText().toString(); String currentText = getText().toString();
if (selectedStartIndex == 0 if (selectedStartIndex == 0
&& (id == android.R.id.cut || id == android.R.id.copy) && (id == android.R.id.cut || id == android.R.id.copy)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment