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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java

Issue 2806373003: Revert "🔍 Hide the Google G by default" (Closed)
Patch Set: 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
Index: chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java
index fa19657f3fb080b2a265ba57abf19e20483af401..f9d8c85e7901e6dd829d526e70037e05faa51dc6 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarPhone.java
@@ -13,7 +13,6 @@ import android.text.Selection;
import android.util.AttributeSet;
import android.view.TouchDelegate;
import android.view.View;
-import android.view.ViewStub;
import android.view.WindowManager;
import android.view.animation.Interpolator;
import android.widget.FrameLayout;
@@ -41,17 +40,16 @@ public class LocationBarPhone extends LocationBarLayout {
private View mFirstVisibleFocusedView;
private View mIncognitoBadge;
+ private View mGoogleGContainer;
+ private View mGoogleG;
private View mUrlActionsContainer;
private int mIncognitoBadgePadding;
+ private int mGoogleGWidth;
+ private int mGoogleGMargin;
private float mUrlFocusChangePercent;
private Runnable mKeyboardResizeModeTask;
private ObjectAnimator mOmniboxBackgroundAnimator;
- private ViewStub mGoogleGContainer;
- private View mGoogleG;
- private int mGoogleGWidth;
- private int mGoogleGMargin;
-
/**
* Constructor used to inflate from XML.
*/
@@ -68,7 +66,8 @@ public class LocationBarPhone extends LocationBarLayout {
mIncognitoBadgePadding =
getResources().getDimensionPixelSize(R.dimen.location_bar_incognito_badge_padding);
- mGoogleGContainer = (ViewStub) findViewById(R.id.google_g_container_stub);
+ mGoogleGContainer = findViewById(R.id.google_g_container);
+ mGoogleG = findViewById(R.id.google_g);
mGoogleGWidth = getResources().getDimensionPixelSize(R.dimen.location_bar_google_g_width);
mGoogleGMargin = getResources().getDimensionPixelSize(R.dimen.location_bar_google_g_margin);
@@ -237,15 +236,11 @@ public class LocationBarPhone extends LocationBarLayout {
// If the default search engine is not Google, isLocationBarShownInNTP() will return false.
if (ntp == null || !ntp.isLocationBarShownInNTP()
|| !ChromeFeatureList.isEnabled(ChromeFeatureList.NTP_SHOW_GOOGLE_G_IN_OMNIBOX)) {
+ mGoogleGContainer.setVisibility(View.GONE);
return;
}
- // Inflate the resource if it hasn't been done yet.
- if (mGoogleG == null) {
- mGoogleGContainer.inflate();
- mGoogleG = findViewById(R.id.google_g);
- }
-
+ mGoogleGContainer.setVisibility(View.VISIBLE);
float animationProgress =
GOOGLE_G_FADE_INTERPOLATOR.getInterpolation(mUrlFocusChangePercent);

Powered by Google App Engine
This is Rietveld 408576698