| Index: chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java | 
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java | 
| index 15bba2f6110b25e7908fc707b0d549ff4fc0e606..ffc3dc48ed7f24ac0a908710b386b771b8350d15 100644 | 
| --- a/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java | 
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/omnibox/LocationBarLayout.java | 
| @@ -1226,16 +1226,24 @@ public class LocationBarLayout extends FrameLayout implements OnClickListener, | 
| * @param securityLevel The security level for which the color will be returned. | 
| * @param provider The {@link ToolbarDataProvider}. | 
| * @param resources The Resources for the Context. | 
| +     * @param isOmniboxOpaque Whether the omnibox is an opaque color. | 
| * @return The {@link ColorStateList} to use to tint the security state icon. | 
| */ | 
| -    public static ColorStateList getColorStateList( | 
| -            int securityLevel, ToolbarDataProvider provider, Resources resources) { | 
| +    public static ColorStateList getColorStateList(int securityLevel, ToolbarDataProvider provider, | 
| +            Resources resources, boolean isOmniboxOpaque) { | 
| ColorStateList list = null; | 
| int color = provider.getPrimaryColor(); | 
| boolean needLightIcon = ColorUtils.shouldUseLightForegroundOnBackground(color); | 
| if (provider.isIncognito() || needLightIcon) { | 
| +            // For a dark theme color, use light icons. | 
| list = ApiCompatibilityUtils.getColorStateList(resources, R.color.light_mode_tint); | 
| +        } else if (!ColorUtils.isUsingDefaultToolbarColor(resources, color) && !isOmniboxOpaque) { | 
| +            // For theme colors which are not dark and are also not | 
| +            // light enough to warrant an opaque URL bar, use dark | 
| +            // icons. | 
| +            list = ApiCompatibilityUtils.getColorStateList(resources, R.color.dark_mode_tint); | 
| } else { | 
| +            // For the default toolbar color, use a green or red icon. | 
| if (securityLevel == ConnectionSecurityLevel.SECURITY_ERROR) { | 
| list = ApiCompatibilityUtils.getColorStateList(resources, R.color.google_red_700); | 
| } else if (securityLevel == ConnectionSecurityLevel.SECURE | 
| @@ -1261,8 +1269,9 @@ public class LocationBarLayout extends FrameLayout implements OnClickListener, | 
| } else { | 
| // ImageView#setImageResource is no-op if given resource is the current one. | 
| mSecurityButton.setImageResource(id); | 
| -            mSecurityButton.setTint( | 
| -                    getColorStateList(securityLevel, getToolbarDataProvider(), getResources())); | 
| +            mSecurityButton.setTint(getColorStateList(securityLevel, getToolbarDataProvider(), | 
| +                    getResources(), ColorUtils.shouldUseOpaqueTextboxBackground( | 
| +                            getToolbarDataProvider().getPrimaryColor()))); | 
| } | 
|  | 
| boolean shouldEmphasizeHttpsScheme = shouldEmphasizeHttpsScheme(); | 
|  |