| 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 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 getBottomSheet().onProcessUrlViewIntent(); | 1038 getBottomSheet().onProcessUrlViewIntent(); |
| 1039 } | 1039 } |
| 1040 | 1040 |
| 1041 // Either a new tab is opening, a tab is being clobbered, or a t
ab is being brought | 1041 // Either a new tab is opening, a tab is being clobbered, or a t
ab is being brought |
| 1042 // to the front. In all scenarios, the bottom sheet should be cl
osed. | 1042 // to the front. In all scenarios, the bottom sheet should be cl
osed. |
| 1043 getBottomSheet().getBottomSheetMetrics().setSheetCloseReason( | 1043 getBottomSheet().getBottomSheetMetrics().setSheetCloseReason( |
| 1044 BottomSheetMetrics.CLOSED_BY_NAVIGATION); | 1044 BottomSheetMetrics.CLOSED_BY_NAVIGATION); |
| 1045 getBottomSheet().setSheetState(BottomSheet.SHEET_STATE_PEEK, tru
e); | 1045 getBottomSheet().setSheetState(BottomSheet.SHEET_STATE_PEEK, tru
e); |
| 1046 } | 1046 } |
| 1047 | 1047 |
| 1048 // We send this intent so that we can enter WebVr presentation mode
if needed. This |
| 1049 // call doesn't consume the intent because it also has the url that
we need to load. |
| 1050 VrShellDelegate.onNewIntent(intent); |
| 1051 |
| 1048 TabModel tabModel = getCurrentTabModel(); | 1052 TabModel tabModel = getCurrentTabModel(); |
| 1049 boolean fromLauncherShortcut = IntentUtils.safeGetBooleanExtra( | 1053 boolean fromLauncherShortcut = IntentUtils.safeGetBooleanExtra( |
| 1050 intent, IntentHandler.EXTRA_INVOKED_FROM_SHORTCUT, false); | 1054 intent, IntentHandler.EXTRA_INVOKED_FROM_SHORTCUT, false); |
| 1051 switch (tabOpenType) { | 1055 switch (tabOpenType) { |
| 1052 case REUSE_URL_MATCHING_TAB_ELSE_NEW_TAB: | 1056 case REUSE_URL_MATCHING_TAB_ELSE_NEW_TAB: |
| 1053 // Used by the bookmarks application. | 1057 // Used by the bookmarks application. |
| 1054 if (tabModel.getCount() > 0 && mUIInitialized | 1058 if (tabModel.getCount() > 0 && mUIInitialized |
| 1055 && mLayoutManager.overviewVisible()) { | 1059 && mLayoutManager.overviewVisible()) { |
| 1056 mLayoutManager.hideOverview(true); | 1060 mLayoutManager.hideOverview(true); |
| 1057 } | 1061 } |
| (...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2107 | 2111 |
| 2108 private boolean shouldCreateNewTabsUsingBottomSheet() { | 2112 private boolean shouldCreateNewTabsUsingBottomSheet() { |
| 2109 if (mShouldCreateNewTabsUsingBottomSheet == null) { | 2113 if (mShouldCreateNewTabsUsingBottomSheet == null) { |
| 2110 mShouldCreateNewTabsUsingBottomSheet = getBottomSheet() != null | 2114 mShouldCreateNewTabsUsingBottomSheet = getBottomSheet() != null |
| 2111 && ChromeFeatureList.isEnabled(ChromeFeatureList.CHROME_HOME
_NTP_REDESIGN); | 2115 && ChromeFeatureList.isEnabled(ChromeFeatureList.CHROME_HOME
_NTP_REDESIGN); |
| 2112 } | 2116 } |
| 2113 | 2117 |
| 2114 return mShouldCreateNewTabsUsingBottomSheet; | 2118 return mShouldCreateNewTabsUsingBottomSheet; |
| 2115 } | 2119 } |
| 2116 } | 2120 } |
| OLD | NEW |