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.AnimatorSet; | 9 import android.animation.AnimatorSet; |
10 import android.annotation.SuppressLint; | 10 import android.annotation.SuppressLint; |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 } | 349 } |
350 mAccessibilitySwitcherButton.setImageDrawable( | 350 mAccessibilitySwitcherButton.setImageDrawable( |
351 incognito ? mTabSwitcherButtonDrawableLight : mTabSwitcherBu
ttonDrawable); | 351 incognito ? mTabSwitcherButtonDrawableLight : mTabSwitcherBu
ttonDrawable); |
352 mLocationBar.updateVisualsForState(); | 352 mLocationBar.updateVisualsForState(); |
353 if (mShowMenuBadge) { | 353 if (mShowMenuBadge) { |
354 setAppMenuUpdateBadgeDrawable(incognito); | 354 setAppMenuUpdateBadgeDrawable(incognito); |
355 } | 355 } |
356 mUseLightColorAssets = incognito; | 356 mUseLightColorAssets = incognito; |
357 } | 357 } |
358 | 358 |
| 359 setMenuButtonHighlightDrawable(mHighlightingMenu); |
359 updateNtp(); | 360 updateNtp(); |
360 } | 361 } |
361 | 362 |
362 /** | 363 /** |
363 * Called when the currently visible New Tab Page changes. | 364 * Called when the currently visible New Tab Page changes. |
364 */ | 365 */ |
365 private void updateNtp() { | 366 private void updateNtp() { |
366 NewTabPage newVisibleNtp = getToolbarDataProvider().getNewTabPageForCurr
entTab(); | 367 NewTabPage newVisibleNtp = getToolbarDataProvider().getNewTabPageForCurr
entTab(); |
367 if (mVisibleNtp == newVisibleNtp) return; | 368 if (mVisibleNtp == newVisibleNtp) return; |
368 | 369 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 mMenuBadge.setVisibility(View.GONE); | 457 mMenuBadge.setVisibility(View.GONE); |
457 setMenuButtonContentDescription(false); | 458 setMenuButtonContentDescription(false); |
458 } | 459 } |
459 } else { | 460 } else { |
460 mIsInTabSwitcherMode = false; | 461 mIsInTabSwitcherMode = false; |
461 mLocationBar.getContainerView().setVisibility(View.VISIBLE); | 462 mLocationBar.getContainerView().setVisibility(View.VISIBLE); |
462 if (mShowMenuBadge) { | 463 if (mShowMenuBadge) { |
463 setAppMenuUpdateBadgeToVisible(false); | 464 setAppMenuUpdateBadgeToVisible(false); |
464 } | 465 } |
465 } | 466 } |
| 467 setMenuButtonHighlightDrawable(mHighlightingMenu); |
466 } | 468 } |
467 | 469 |
468 @Override | 470 @Override |
469 protected void updateTabCountVisuals(int numberOfTabs) { | 471 protected void updateTabCountVisuals(int numberOfTabs) { |
470 mAccessibilitySwitcherButton.setContentDescription( | 472 mAccessibilitySwitcherButton.setContentDescription( |
471 getResources().getQuantityString( | 473 getResources().getQuantityString( |
472 R.plurals.accessibility_toolbar_btn_tabswitcher_toggle, | 474 R.plurals.accessibility_toolbar_btn_tabswitcher_toggle, |
473 numberOfTabs, numberOfTabs)); | 475 numberOfTabs, numberOfTabs)); |
474 mTabSwitcherButtonDrawable.updateForTabCount(numberOfTabs, isIncognito()
); | 476 mTabSwitcherButtonDrawable.updateForTabCount(numberOfTabs, isIncognito()
); |
475 mTabSwitcherButtonDrawableLight.updateForTabCount(numberOfTabs, isIncogn
ito()); | 477 mTabSwitcherButtonDrawableLight.updateForTabCount(numberOfTabs, isIncogn
ito()); |
(...skipping 19 matching lines...) Expand all Loading... |
495 protected void onHomeButtonUpdate(boolean homeButtonEnabled) { | 497 protected void onHomeButtonUpdate(boolean homeButtonEnabled) { |
496 mHomeButton.setVisibility(homeButtonEnabled ? VISIBLE : GONE); | 498 mHomeButton.setVisibility(homeButtonEnabled ? VISIBLE : GONE); |
497 } | 499 } |
498 | 500 |
499 @Override | 501 @Override |
500 public LocationBar getLocationBar() { | 502 public LocationBar getLocationBar() { |
501 return mLocationBar; | 503 return mLocationBar; |
502 } | 504 } |
503 | 505 |
504 @Override | 506 @Override |
| 507 public boolean useLightDrawables() { |
| 508 return mUseLightColorAssets; |
| 509 } |
| 510 |
| 511 @Override |
505 public void showAppMenuUpdateBadge() { | 512 public void showAppMenuUpdateBadge() { |
506 super.showAppMenuUpdateBadge(); | 513 super.showAppMenuUpdateBadge(); |
507 if (!mIsInTabSwitcherMode) { | 514 if (!mIsInTabSwitcherMode) { |
508 if (mUseLightColorAssets) { | 515 if (mUseLightColorAssets) { |
509 setAppMenuUpdateBadgeDrawable(mUseLightColorAssets); | 516 setAppMenuUpdateBadgeDrawable(mUseLightColorAssets); |
510 } | 517 } |
511 setAppMenuUpdateBadgeToVisible(true); | 518 setAppMenuUpdateBadgeToVisible(true); |
512 } | 519 } |
513 } | 520 } |
514 | 521 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 } | 655 } |
649 | 656 |
650 mButtonVisibilityAnimators = null; | 657 mButtonVisibilityAnimators = null; |
651 } | 658 } |
652 }); | 659 }); |
653 | 660 |
654 return set; | 661 return set; |
655 } | 662 } |
656 | 663 |
657 } | 664 } |
OLD | NEW |