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; | 5 package org.chromium.chrome.browser; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.annotation.TargetApi; | 8 import android.annotation.TargetApi; |
9 import android.app.Activity; | 9 import android.app.Activity; |
10 import android.app.ActivityManager; | 10 import android.app.ActivityManager; |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 @Override | 582 @Override |
583 public void onStart() { | 583 public void onStart() { |
584 super.onStart(); | 584 super.onStart(); |
585 StartupMetrics.getInstance().updateIntent(getIntent()); | 585 StartupMetrics.getInstance().updateIntent(getIntent()); |
586 } | 586 } |
587 | 587 |
588 @Override | 588 @Override |
589 public void onStartWithNative() { | 589 public void onStartWithNative() { |
590 super.onStartWithNative(); | 590 super.onStartWithNative(); |
591 // If we don't have a current tab, show the overview mode. | 591 // If we don't have a current tab, show the overview mode. |
592 if (getActivityTab() == null) mLayoutManager.showOverview(false); | 592 if (getActivityTab() == null && !mLayoutManager.overviewVisible()) { |
| 593 mLayoutManager.showOverview(false); |
| 594 } |
593 | 595 |
594 resetSavedInstanceState(); | 596 resetSavedInstanceState(); |
595 } | 597 } |
596 | 598 |
597 @Override | 599 @Override |
598 public void onNewIntentWithNative(Intent intent) { | 600 public void onNewIntentWithNative(Intent intent) { |
599 try { | 601 try { |
600 TraceEvent.begin("ChromeTabbedActivity.onNewIntentWithNative"); | 602 TraceEvent.begin("ChromeTabbedActivity.onNewIntentWithNative"); |
601 | 603 |
602 super.onNewIntentWithNative(intent); | 604 super.onNewIntentWithNative(intent); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 | 647 |
646 private void initializeUI() { | 648 private void initializeUI() { |
647 try { | 649 try { |
648 TraceEvent.begin("ChromeTabbedActivity.initializeUI"); | 650 TraceEvent.begin("ChromeTabbedActivity.initializeUI"); |
649 | 651 |
650 CompositorViewHolder compositorViewHolder = getCompositorViewHolder(
); | 652 CompositorViewHolder compositorViewHolder = getCompositorViewHolder(
); |
651 if (DeviceFormFactor.isTablet()) { | 653 if (DeviceFormFactor.isTablet()) { |
652 mLayoutManager = new LayoutManagerChromeTablet(compositorViewHol
der); | 654 mLayoutManager = new LayoutManagerChromeTablet(compositorViewHol
der); |
653 } else { | 655 } else { |
654 mLayoutManager = new LayoutManagerChromePhone(compositorViewHold
er); | 656 mLayoutManager = new LayoutManagerChromePhone(compositorViewHold
er); |
| 657 if (getBottomSheet() != null) { |
| 658 ((LayoutManagerChromePhone) mLayoutManager) |
| 659 .setForegroundTabAnimationDisabled(true); |
| 660 } |
655 } | 661 } |
656 mLayoutManager.setEnableAnimations(DeviceClassManager.enableAnimatio
ns()); | 662 mLayoutManager.setEnableAnimations(DeviceClassManager.enableAnimatio
ns()); |
657 mLayoutManager.addOverviewModeObserver(this); | 663 mLayoutManager.addOverviewModeObserver(this); |
658 | 664 |
659 if (getBottomSheet() != null) getBottomSheet().setLayoutManagerChrom
e(mLayoutManager); | 665 if (getBottomSheet() != null) getBottomSheet().setLayoutManagerChrom
e(mLayoutManager); |
660 | 666 |
661 // TODO(yusufo): get rid of findViewById(R.id.url_bar). | 667 // TODO(yusufo): get rid of findViewById(R.id.url_bar). |
662 initializeCompositorContent(mLayoutManager, findViewById(R.id.url_ba
r), | 668 initializeCompositorContent(mLayoutManager, findViewById(R.id.url_ba
r), |
663 mContentContainer, mControlContainer); | 669 mContentContainer, mControlContainer); |
664 | 670 |
(...skipping 1446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2111 | 2117 |
2112 private boolean shouldCreateNewTabsUsingBottomSheet() { | 2118 private boolean shouldCreateNewTabsUsingBottomSheet() { |
2113 if (mShouldCreateNewTabsUsingBottomSheet == null) { | 2119 if (mShouldCreateNewTabsUsingBottomSheet == null) { |
2114 mShouldCreateNewTabsUsingBottomSheet = getBottomSheet() != null | 2120 mShouldCreateNewTabsUsingBottomSheet = getBottomSheet() != null |
2115 && ChromeFeatureList.isEnabled(ChromeFeatureList.CHROME_HOME
_NTP_REDESIGN); | 2121 && ChromeFeatureList.isEnabled(ChromeFeatureList.CHROME_HOME
_NTP_REDESIGN); |
2116 } | 2122 } |
2117 | 2123 |
2118 return mShouldCreateNewTabsUsingBottomSheet; | 2124 return mShouldCreateNewTabsUsingBottomSheet; |
2119 } | 2125 } |
2120 } | 2126 } |
OLD | NEW |