Unreviewed changes
3 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: components/omnibox/browser/omnibox_word_boundary_unittest.cc
Insertions: 13, Deletions: 0.
@@ -18,6 +18,13 @@
EXPECT_EQ(7, GetDeletionBoundary(u"google.com/path", 11, false));
EXPECT_EQ(0, GetDeletionBoundary(u"https://google.com", 8, false));
+
+ EXPECT_EQ(11, GetDeletionBoundary(u"google.com:8080", 15, false));
+
+ EXPECT_EQ(11, GetDeletionBoundary(u"google.com/path_/file.html", 17, false));
+
+ EXPECT_EQ(11, GetDeletionBoundary(u"[2001:db8::1]", 13, false));
+ EXPECT_EQ(6, GetDeletionBoundary(u"[2001:db8::1]", 11, false));
}
TEST(OmniboxWordBoundaryTest, GetDeletionBoundary_Forward) {
@@ -28,6 +35,12 @@
EXPECT_EQ(15, GetDeletionBoundary(u"google.com/path", 10, true));
EXPECT_EQ(14, GetDeletionBoundary(u"https://google.com", 5, true));
+
+ EXPECT_EQ(15, GetDeletionBoundary(u"google.com:8080", 10, true));
+
+ EXPECT_EQ(21, GetDeletionBoundary(u"google.com/path_/file.html", 16, true));
+
+ EXPECT_EQ(9, GetDeletionBoundary(u"[2001:db8::1]", 5, true));
}
} // namespace omnibox
```
```
The name of the file: chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/AutocompleteEditTextModelBase.java
Insertions: 2, Deletions: 2.
@@ -247,8 +247,8 @@
boolean shouldIgnoreAccessibilityEvent();
/**
- * @return Whether the given key event represents a delete-by-word gesture that should be
- * intercepted and handled by the model.
+ * Returns whether the given key event represents a delete-by-word gesture that should be
+ * intercepted and handled by the model.
*/
boolean isDeleteByWord(KeyEvent event);
}
```
Change information
Commit message:
Align Android Omnibox word deletion with desktop
This patch implements custom word deletion for Android Omnibox.
Previously these key events were consumed by the IME and handled using
Android's native rules. We override this so that word deletion is routed
to dispatchKeyEvent. A JNI bridge OmniboxWordBoundary is created to use
the base::i18n::BreakIterator for calculating the exact
desktop-consistent word boundaries. And we delete words according to
this.
This builds on top of forward deletion, so that it supports backward and
forward word deletion.
Bug: 514800370
Change-Id: Ie14df1fa466e79912f63e43ac65c8da8095f9b1f
Cr-Commit-Position: refs/heads/main@{#1658739}
Files:
- M chrome/browser/ui/android/omnibox/BUILD.gn
- M chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/AutocompleteEditText.java
- M chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/AutocompleteEditTextModelBase.java
- M chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/SpannableAutocompleteEditTextModel.java
- M chrome/browser/ui/android/omnibox/java/src/org/chromium/chrome/browser/omnibox/SpannableAutocompleteEditTextModelUnitTest.java
- M components/omnibox/browser/BUILD.gn
- A components/omnibox/browser/android/java/src/org/chromium/components/omnibox/OmniboxWordBoundary.java
- A components/omnibox/browser/omnibox_word_boundary.cc
- A components/omnibox/browser/omnibox_word_boundary.h
- A components/omnibox/browser/omnibox_word_boundary_unittest.cc
Change size: L
Delta: 10 files changed, 273 insertions(+), 0 deletions(-)
Branch: refs/heads/main
Submit Requirements:
Code-Review: +1 by Patrick Noland, +1 by Sky Malice