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.omnibox; | 5 package org.chromium.chrome.browser.omnibox; |
6 | 6 |
7 import static org.chromium.chrome.browser.toolbar.ToolbarPhone.URL_FOCUS_CHANGE_ ANIMATION_DURATION_MS; | 7 import static org.chromium.chrome.browser.toolbar.ToolbarPhone.URL_FOCUS_CHANGE_ ANIMATION_DURATION_MS; |
8 | 8 |
9 import android.Manifest; | 9 import android.Manifest; |
10 import android.animation.Animator; | 10 import android.animation.Animator; |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
664 mNavigationButton.setVisibility(VISIBLE); | 664 mNavigationButton.setVisibility(VISIBLE); |
665 mSecurityButton.setVisibility(INVISIBLE); | 665 mSecurityButton.setVisibility(INVISIBLE); |
666 | 666 |
667 setLayoutTransition(null); | 667 setLayoutTransition(null); |
668 | 668 |
669 AnimatorListenerAdapter iconChangeAnimatorListener = new AnimatorListene rAdapter() { | 669 AnimatorListenerAdapter iconChangeAnimatorListener = new AnimatorListene rAdapter() { |
670 @Override | 670 @Override |
671 public void onAnimationEnd(Animator animation) { | 671 public void onAnimationEnd(Animator animation) { |
672 if (animation == mSecurityButtonShowAnimator) { | 672 if (animation == mSecurityButtonShowAnimator) { |
673 mNavigationButton.setVisibility(INVISIBLE); | 673 mNavigationButton.setVisibility(INVISIBLE); |
674 // This is done specifically not to show offline page verbos e status with the | |
675 // icon. It should be properly solved, when omnibox verbose status animation is | |
676 // implemented. See: http://crbug.com/648129 | |
677 updateVerboseStatusVisibility(); | |
678 setUrlToPageUrl(); | |
Ted C
2016/10/12 23:46:22
why setUrlToPageUrl? That doesn't look right to m
fgorski
2016/10/13 18:04:35
If we don't we can get padlock shown with a scheme
| |
674 } else if (animation == mNavigationIconShowAnimator) { | 679 } else if (animation == mNavigationIconShowAnimator) { |
675 mSecurityButton.setVisibility(INVISIBLE); | 680 mSecurityButton.setVisibility(INVISIBLE); |
676 } | 681 } |
677 } | 682 } |
678 | 683 |
679 @Override | 684 @Override |
680 public void onAnimationStart(Animator animation) { | 685 public void onAnimationStart(Animator animation) { |
681 if (animation == mSecurityButtonShowAnimator) { | 686 if (animation == mSecurityButtonShowAnimator) { |
Ted C
2016/10/12 23:46:22
should we ever be showing the verbose state during
fgorski
2016/10/13 18:04:35
Done, with exception of the last &&. Please check
| |
682 mSecurityButton.setVisibility(VISIBLE); | 687 mSecurityButton.setVisibility(VISIBLE); |
683 } else if (animation == mNavigationIconShowAnimator) { | 688 } else if (animation == mNavigationIconShowAnimator) { |
684 mNavigationButton.setVisibility(VISIBLE); | 689 mNavigationButton.setVisibility(VISIBLE); |
685 } | 690 } |
686 } | 691 } |
687 }; | 692 }; |
688 | 693 |
689 mSecurityButtonShowAnimator = new AnimatorSet(); | 694 mSecurityButtonShowAnimator = new AnimatorSet(); |
690 mSecurityButtonShowAnimator.playTogether( | 695 mSecurityButtonShowAnimator.playTogether( |
691 ObjectAnimator.ofFloat(mNavigationButton, ALPHA, 0), | 696 ObjectAnimator.ofFloat(mNavigationButton, ALPHA, 0), |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1382 | 1387 |
1383 updateVerboseStatusVisibility(); | 1388 updateVerboseStatusVisibility(); |
1384 updateLocationBarIconContainerVisibility(); | 1389 updateLocationBarIconContainerVisibility(); |
1385 } | 1390 } |
1386 | 1391 |
1387 /** | 1392 /** |
1388 * Update visibility of the verbose status based on the button type and focu s state of the | 1393 * Update visibility of the verbose status based on the button type and focu s state of the |
1389 * omnibox. | 1394 * omnibox. |
1390 */ | 1395 */ |
1391 private void updateVerboseStatusVisibility() { | 1396 private void updateVerboseStatusVisibility() { |
1392 boolean verboseStatusVisible = | 1397 boolean verboseStatusVisible = mNavigationButtonType == NavigationButton Type.OFFLINE |
1393 mNavigationButtonType == NavigationButtonType.OFFLINE && !mUrlHa sFocus; | 1398 && !mUrlHasFocus && mNavigationButton.getVisibility() == VISIBLE ; |
1394 | 1399 |
1395 int verboseStatusVisibility = verboseStatusVisible ? VISIBLE : GONE; | 1400 int verboseStatusVisibility = verboseStatusVisible ? VISIBLE : GONE; |
1396 | 1401 |
1397 mVerboseStatusTextView.setTextColor(ApiCompatibilityUtils.getColor(getRe sources(), | 1402 mVerboseStatusTextView.setTextColor(ApiCompatibilityUtils.getColor(getRe sources(), |
1398 mUseDarkColors ? R.color.locationbar_status_color | 1403 mUseDarkColors ? R.color.locationbar_status_color |
1399 : R.color.locationbar_status_color_light)); | 1404 : R.color.locationbar_status_color_light)); |
1400 mVerboseStatusTextView.setVisibility(verboseStatusVisibility); | 1405 mVerboseStatusTextView.setVisibility(verboseStatusVisibility); |
1401 | 1406 |
1402 View separator = findViewById(R.id.location_bar_verbose_status_separator ); | 1407 View separator = findViewById(R.id.location_bar_verbose_status_separator ); |
1403 separator.setBackgroundColor(ApiCompatibilityUtils.getColor(getResources (), mUseDarkColors | 1408 separator.setBackgroundColor(ApiCompatibilityUtils.getColor(getResources (), mUseDarkColors |
(...skipping 1063 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2467 public View getContainerView() { | 2472 public View getContainerView() { |
2468 return this; | 2473 return this; |
2469 } | 2474 } |
2470 | 2475 |
2471 @Override | 2476 @Override |
2472 public void setTitleToPageTitle() { } | 2477 public void setTitleToPageTitle() { } |
2473 | 2478 |
2474 @Override | 2479 @Override |
2475 public void setShowTitle(boolean showTitle) { } | 2480 public void setShowTitle(boolean showTitle) { } |
2476 } | 2481 } |
OLD | NEW |