| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package org.chromium.chrome.browser.toolbar; | 5 package org.chromium.chrome.browser.toolbar; |
| 6 | 6 |
| 7 import android.animation.Animator; | 7 import android.animation.Animator; |
| 8 import android.animation.AnimatorListenerAdapter; | 8 import android.animation.AnimatorListenerAdapter; |
| 9 import android.animation.ValueAnimator; | 9 import android.animation.ValueAnimator; |
| 10 import android.animation.ValueAnimator.AnimatorUpdateListener; | 10 import android.animation.ValueAnimator.AnimatorUpdateListener; |
| (...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 if (securityLevel == ConnectionSecurityLevel.NONE) { | 501 if (securityLevel == ConnectionSecurityLevel.NONE) { |
| 502 mAnimDelegate.hideSecurityButton(); | 502 mAnimDelegate.hideSecurityButton(); |
| 503 } else { | 503 } else { |
| 504 boolean isSmallDevice = !DeviceFormFactor.isTablet(getContext()); | 504 boolean isSmallDevice = !DeviceFormFactor.isTablet(getContext()); |
| 505 int id = LocationBarLayout.getSecurityIconResource(securityLevel, is
SmallDevice); | 505 int id = LocationBarLayout.getSecurityIconResource(securityLevel, is
SmallDevice); |
| 506 if (id == 0) { | 506 if (id == 0) { |
| 507 mSecurityButton.setImageDrawable(null); | 507 mSecurityButton.setImageDrawable(null); |
| 508 } else { | 508 } else { |
| 509 // ImageView#setImageResource is no-op if given resource is the
current one. | 509 // ImageView#setImageResource is no-op if given resource is the
current one. |
| 510 mSecurityButton.setImageResource(id); | 510 mSecurityButton.setImageResource(id); |
| 511 mSecurityButton.setTint(LocationBarLayout.getColorStateList( | 511 mSecurityButton.setTint( |
| 512 securityLevel, getToolbarDataProvider(), getResources())
); | 512 LocationBarLayout.getColorStateList(securityLevel, getTo
olbarDataProvider(), |
| 513 getResources(), false /* omnibox is not opaque *
/)); |
| 513 } | 514 } |
| 514 mAnimDelegate.showSecurityButton(); | 515 mAnimDelegate.showSecurityButton(); |
| 515 } | 516 } |
| 516 mUrlBar.emphasizeUrl(); | 517 mUrlBar.emphasizeUrl(); |
| 517 mUrlBar.invalidate(); | 518 mUrlBar.invalidate(); |
| 518 } | 519 } |
| 519 | 520 |
| 520 private void showOfflineBoltIfNecessary() { | 521 private void showOfflineBoltIfNecessary() { |
| 521 boolean isOfflinePage = getCurrentTab() != null && getCurrentTab().isOff
linePage(); | 522 boolean isOfflinePage = getCurrentTab() != null && getCurrentTab().isOff
linePage(); |
| 522 if (isOfflinePage == mShowsOfflinePage) return; | 523 if (isOfflinePage == mShowsOfflinePage) return; |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 | 757 |
| 757 @Override | 758 @Override |
| 758 protected void setAppMenuUpdateBadgeToVisible(boolean animate) {} | 759 protected void setAppMenuUpdateBadgeToVisible(boolean animate) {} |
| 759 | 760 |
| 760 @Override | 761 @Override |
| 761 public View getMenuButtonWrapper() { | 762 public View getMenuButtonWrapper() { |
| 762 // This class has no menu button wrapper, so return the menu button inst
ead. | 763 // This class has no menu button wrapper, so return the menu button inst
ead. |
| 763 return mMenuButton; | 764 return mMenuButton; |
| 764 } | 765 } |
| 765 } | 766 } |
| OLD | NEW |