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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 * Triggered when the current tab or model has changed. | 412 * Triggered when the current tab or model has changed. |
413 * <p> | 413 * <p> |
414 * As there are cases where you can select a model with no tabs (i.e. having
incognito | 414 * As there are cases where you can select a model with no tabs (i.e. having
incognito |
415 * tabs but no normal tabs will still allow you to select the normal model),
this should | 415 * tabs but no normal tabs will still allow you to select the normal model),
this should |
416 * not guarantee that the model's current tab is non-null. | 416 * not guarantee that the model's current tab is non-null. |
417 */ | 417 */ |
418 protected void onTabOrModelChanged() { | 418 protected void onTabOrModelChanged() { |
419 NewTabPage ntp = getToolbarDataProvider().getNewTabPageForCurrentTab(); | 419 NewTabPage ntp = getToolbarDataProvider().getNewTabPageForCurrentTab(); |
420 if (ntp != null) { | 420 if (ntp != null) { |
421 getLocationBar().onTabLoadingNTP(ntp); | 421 getLocationBar().onTabLoadingNTP(ntp); |
422 } else { | |
423 if (mUrlContainer != null) mUrlContainer.setTrailingTextVisible(true
); | |
424 } | 422 } |
425 | 423 |
426 getLocationBar().updateMicButtonState(); | 424 getLocationBar().updateMicButtonState(); |
427 } | 425 } |
428 | 426 |
429 /** | 427 /** |
430 * For extending classes to override and carry out the changes related with
the primary color | 428 * For extending classes to override and carry out the changes related with
the primary color |
431 * for the current tab changing. | 429 * for the current tab changing. |
432 */ | 430 */ |
433 protected void onPrimaryColorChanged(boolean shouldAnimate) { } | 431 protected void onPrimaryColorChanged(boolean shouldAnimate) { } |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 * Returns the elapsed realtime in ms of the time at which first draw for th
e toolbar occurred. | 558 * Returns the elapsed realtime in ms of the time at which first draw for th
e toolbar occurred. |
561 */ | 559 */ |
562 public long getFirstDrawTime() { | 560 public long getFirstDrawTime() { |
563 return mFirstDrawTimeMs; | 561 return mFirstDrawTimeMs; |
564 } | 562 } |
565 | 563 |
566 /** | 564 /** |
567 * Notified when a navigation to a different page has occurred. | 565 * Notified when a navigation to a different page has occurred. |
568 */ | 566 */ |
569 protected void onNavigatedToDifferentPage() { | 567 protected void onNavigatedToDifferentPage() { |
570 if (mUrlContainer != null) mUrlContainer.setTrailingTextVisible(true); | |
571 } | 568 } |
572 | 569 |
573 /** | 570 /** |
574 * Starts load progress. | 571 * Starts load progress. |
575 */ | 572 */ |
576 protected void startLoadProgress() { | 573 protected void startLoadProgress() { |
577 if (mProgressBar != null) { | 574 if (mProgressBar != null) { |
578 mProgressBar.start(); | 575 mProgressBar.start(); |
579 } | 576 } |
580 } | 577 } |
(...skipping 10 matching lines...) Expand all Loading... |
591 | 588 |
592 /** | 589 /** |
593 * Finishes load progress. | 590 * Finishes load progress. |
594 * @param delayed Whether hiding progress bar should be delayed to give enou
gh time for user to | 591 * @param delayed Whether hiding progress bar should be delayed to give enou
gh time for user to |
595 * recognize the last state. | 592 * recognize the last state. |
596 */ | 593 */ |
597 protected void finishLoadProgress(boolean delayed) { | 594 protected void finishLoadProgress(boolean delayed) { |
598 if (mProgressBar != null) { | 595 if (mProgressBar != null) { |
599 mProgressBar.finish(delayed); | 596 mProgressBar.finish(delayed); |
600 } | 597 } |
601 if (mUrlContainer != null) mUrlContainer.setTrailingTextVisible(false); | |
602 } | 598 } |
603 | 599 |
604 /** | 600 /** |
605 * Finish any toolbar animations. | 601 * Finish any toolbar animations. |
606 */ | 602 */ |
607 public void finishAnimations() { } | 603 public void finishAnimations() { } |
608 | 604 |
609 /** | 605 /** |
610 * @return The current View showing in the Tab. | 606 * @return The current View showing in the Tab. |
611 */ | 607 */ |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 } else { | 777 } else { |
782 mMenuButton.setContentDescription(getResources().getString( | 778 mMenuButton.setContentDescription(getResources().getString( |
783 R.string.accessibility_toolbar_btn_menu)); | 779 R.string.accessibility_toolbar_btn_menu)); |
784 } | 780 } |
785 } | 781 } |
786 | 782 |
787 @Override | 783 @Override |
788 public void setReturnButtonListener(View.OnClickListener listener) { | 784 public void setReturnButtonListener(View.OnClickListener listener) { |
789 } | 785 } |
790 } | 786 } |
OLD | NEW |