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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 if (getCurrentTab() == null) return ConnectionSecurityLevel.NONE; | 460 if (getCurrentTab() == null) return ConnectionSecurityLevel.NONE; |
461 return getCurrentTab().getSecurityLevel(); | 461 return getCurrentTab().getSecurityLevel(); |
462 } | 462 } |
463 | 463 |
464 @Override | 464 @Override |
465 public void updateSecurityIcon(int securityLevel) { | 465 public void updateSecurityIcon(int securityLevel) { |
466 if (mState == STATE_TITLE_ONLY) return; | 466 if (mState == STATE_TITLE_ONLY) return; |
467 | 467 |
468 mSecurityIconType = securityLevel; | 468 mSecurityIconType = securityLevel; |
469 | 469 |
470 boolean isSmallDevice = !DeviceFormFactor.isTablet(getContext()); | 470 boolean isSmallDevice = !DeviceFormFactor.isTablet(); |
471 boolean isOfflinePage = | 471 boolean isOfflinePage = |
472 getCurrentTab() != null && OfflinePageUtils.isOfflinePage(getCur
rentTab()); | 472 getCurrentTab() != null && OfflinePageUtils.isOfflinePage(getCur
rentTab()); |
473 | 473 |
474 int id = LocationBarLayout.getSecurityIconResource( | 474 int id = LocationBarLayout.getSecurityIconResource( |
475 securityLevel, isSmallDevice, isOfflinePage); | 475 securityLevel, isSmallDevice, isOfflinePage); |
476 boolean showSecurityButton = true; | 476 boolean showSecurityButton = true; |
477 if (id == 0) { | 477 if (id == 0) { |
478 // Hide the button if we don't have an actual icon to display. | 478 // Hide the button if we don't have an actual icon to display. |
479 showSecurityButton = false; | 479 showSecurityButton = false; |
480 mSecurityButton.setImageDrawable(null); | 480 mSecurityButton.setImageDrawable(null); |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 public View getMenuButtonWrapper() { | 741 public View getMenuButtonWrapper() { |
742 // This class has no menu button wrapper, so return the menu button inst
ead. | 742 // This class has no menu button wrapper, so return the menu button inst
ead. |
743 return mMenuButton; | 743 return mMenuButton; |
744 } | 744 } |
745 | 745 |
746 @Override | 746 @Override |
747 public boolean mustQueryUrlBarLocationForSuggestions() { | 747 public boolean mustQueryUrlBarLocationForSuggestions() { |
748 return false; | 748 return false; |
749 } | 749 } |
750 } | 750 } |
OLD | NEW |