Commit 50e675c5 authored by dfalcantara's avatar dfalcantara Committed by Commit bot

Revert of Fix omnibox suggestions being overdrawn with the nav bar. (patchset...

Revert of Fix omnibox suggestions being overdrawn with the nav bar. (patchset #1 id:1 of https://codereview.chromium.org/2849283002/ )

Reason for revert:
Caused https://bugs.chromium.org/p/chromium/issues/detail?id=717395

Got the go ahead to revert over email.  Will continue investigating what's going on in the bug as a follow up.

Original issue's description:
> Fix omnibox suggestions being overdrawn with the nav bar.
>
> getLocationInWindow adjusts for the Android nav bar, while the
> positioning of the parent is exclusive of the nav bar.  This causes
> the suggestions be too bar left aligned and cut off.
>
> Only visible if you have the nav bar aligned with the start of
> the text (i.e. on the left with LTR text).
>
> BUG=669150
>
> Review-Url: https://codereview.chromium.org/2849283002
> Cr-Commit-Position: refs/heads/master@{#468466}
> Committed: https://chromium.googlesource.com/chromium/src/+/c0fd363129a9a01abe8954eb9b23beadaf6ea984

TBR=mdjones@chromium.org,tedchoc@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=669150

Review-Url: https://codereview.chromium.org/2853993002
Cr-Commit-Position: refs/heads/master@{#468567}
parent 1df4bbd0
...@@ -35,7 +35,6 @@ import org.chromium.chrome.R; ...@@ -35,7 +35,6 @@ import org.chromium.chrome.R;
import org.chromium.chrome.browser.omnibox.OmniboxResultsAdapter.OmniboxResultItem; import org.chromium.chrome.browser.omnibox.OmniboxResultsAdapter.OmniboxResultItem;
import org.chromium.chrome.browser.omnibox.OmniboxResultsAdapter.OmniboxSuggestionDelegate; import org.chromium.chrome.browser.omnibox.OmniboxResultsAdapter.OmniboxSuggestionDelegate;
import org.chromium.chrome.browser.omnibox.OmniboxSuggestion.MatchClassification; import org.chromium.chrome.browser.omnibox.OmniboxSuggestion.MatchClassification;
import org.chromium.chrome.browser.util.ViewUtils;
import org.chromium.chrome.browser.widget.TintedDrawable; import org.chromium.chrome.browser.widget.TintedDrawable;
import org.chromium.ui.base.DeviceFormFactor; import org.chromium.ui.base.DeviceFormFactor;
...@@ -863,8 +862,7 @@ class SuggestionView extends ViewGroup { ...@@ -863,8 +862,7 @@ class SuggestionView extends ViewGroup {
private int getUrlBarLeftOffset() { private int getUrlBarLeftOffset() {
if (mLocationBar.mustQueryUrlBarLocationForSuggestions()) { if (mLocationBar.mustQueryUrlBarLocationForSuggestions()) {
View contentView = getRootView().findViewById(android.R.id.content); mUrlBar.getLocationInWindow(mViewPositionHolder);
ViewUtils.getRelativeLayoutPosition(contentView, mUrlBar, mViewPositionHolder);
return mViewPositionHolder[0]; return mViewPositionHolder[0];
} else { } else {
return ApiCompatibilityUtils.isLayoutRtl(this) ? mPhoneUrlBarLeftOffsetRtlPx return ApiCompatibilityUtils.isLayoutRtl(this) ? mPhoneUrlBarLeftOffsetRtlPx
...@@ -879,8 +877,7 @@ class SuggestionView extends ViewGroup { ...@@ -879,8 +877,7 @@ class SuggestionView extends ViewGroup {
if (mLocationBar == null) return 0; if (mLocationBar == null) return 0;
int leftOffset = getUrlBarLeftOffset(); int leftOffset = getUrlBarLeftOffset();
View contentView = getRootView().findViewById(android.R.id.content); getLocationInWindow(mViewPositionHolder);
ViewUtils.getRelativeLayoutPosition(contentView, this, mViewPositionHolder);
return leftOffset + mUrlBar.getPaddingLeft() - mViewPositionHolder[0]; return leftOffset + mUrlBar.getPaddingLeft() - mViewPositionHolder[0];
} }
...@@ -891,8 +888,7 @@ class SuggestionView extends ViewGroup { ...@@ -891,8 +888,7 @@ class SuggestionView extends ViewGroup {
if (mLocationBar == null) return 0; if (mLocationBar == null) return 0;
int leftOffset = getUrlBarLeftOffset(); int leftOffset = getUrlBarLeftOffset();
View contentView = getRootView().findViewById(android.R.id.content); getLocationInWindow(mViewPositionHolder);
ViewUtils.getRelativeLayoutPosition(contentView, this, mViewPositionHolder);
return leftOffset + mUrlBar.getWidth() - mUrlBar.getPaddingRight() return leftOffset + mUrlBar.getWidth() - mUrlBar.getPaddingRight()
- mViewPositionHolder[0]; - mViewPositionHolder[0];
} }
......
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