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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/util/ViewUtils.java

Issue 2856943002: Revert "Revert of Fix omnibox suggestions being overdrawn with the nav bar. (patchset #1 id:1 of ht… (Closed)
Patch Set: Rebase Created 3 years, 8 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 | « chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/util/ViewUtils.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/util/ViewUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/util/ViewUtils.java
index 79d4f02e925c1d7b078945ff4810c104ced222e0..afd81ad14e7c279c2051070e8289337d3bb077a5 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/util/ViewUtils.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/util/ViewUtils.java
@@ -68,9 +68,11 @@ public class ViewUtils {
assert outPosition.length == 2;
outPosition[0] = 0;
outPosition[1] = 0;
- while (childView != null && childView != rootView) {
+ if (rootView == null || childView == rootView) return;
+ while (childView != null) {
outPosition[0] += childView.getLeft();
outPosition[1] += childView.getTop();
+ if (childView.getParent() == rootView) break;
childView = (View) childView.getParent();
}
}
@@ -87,9 +89,11 @@ public class ViewUtils {
assert outPosition.length == 2;
outPosition[0] = 0;
outPosition[1] = 0;
- while (childView != null && childView != rootView) {
+ if (rootView == null || childView == rootView) return;
+ while (childView != null) {
outPosition[0] += childView.getX();
outPosition[1] += childView.getY();
+ if (childView.getParent() == rootView) break;
childView = (View) childView.getParent();
}
}
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/omnibox/SuggestionView.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698