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.app.Activity; | 7 import android.app.Activity; |
8 import android.app.ActivityManager; | 8 import android.app.ActivityManager; |
9 import android.content.Context; | 9 import android.content.Context; |
10 import android.content.Intent; | 10 import android.content.Intent; |
(...skipping 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 | 1084 |
1085 private void moveTabToOtherWindow(Tab tab) { | 1085 private void moveTabToOtherWindow(Tab tab) { |
1086 Class<? extends Activity> targetActivity = | 1086 Class<? extends Activity> targetActivity = |
1087 MultiWindowUtils.getInstance().getOpenInOtherWindowActivity(this
); | 1087 MultiWindowUtils.getInstance().getOpenInOtherWindowActivity(this
); |
1088 if (targetActivity == null) return; | 1088 if (targetActivity == null) return; |
1089 | 1089 |
1090 Intent intent = new Intent(this, targetActivity); | 1090 Intent intent = new Intent(this, targetActivity); |
1091 intent.setClass(this, targetActivity); | 1091 intent.setClass(this, targetActivity); |
1092 intent.setFlags(MultiWindowUtils.FLAG_ACTIVITY_LAUNCH_ADJACENT); | 1092 intent.setFlags(MultiWindowUtils.FLAG_ACTIVITY_LAUNCH_ADJACENT); |
1093 | 1093 |
1094 tab.detachAndStartReparenting(intent, null, null); | 1094 tab.detachAndStartReparenting(intent, null, null, true); |
1095 } | 1095 } |
1096 | 1096 |
1097 @Override | 1097 @Override |
1098 public boolean handleBackPressed() { | 1098 public boolean handleBackPressed() { |
1099 if (!mUIInitialized) return false; | 1099 if (!mUIInitialized) return false; |
1100 final Tab currentTab = getActivityTab(); | 1100 final Tab currentTab = getActivityTab(); |
1101 | 1101 |
1102 if (currentTab == null) { | 1102 if (currentTab == null) { |
1103 recordBackPressedUma("currentTab is null", BACK_PRESSED_TAB_IS_NULL)
; | 1103 recordBackPressedUma("currentTab is null", BACK_PRESSED_TAB_IS_NULL)
; |
1104 moveTaskToBack(true); | 1104 moveTaskToBack(true); |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 if (getActivityTab() != null) { | 1418 if (getActivityTab() != null) { |
1419 setStatusBarColor(getActivityTab(), getActivityTab().getThemeColor()
); | 1419 setStatusBarColor(getActivityTab(), getActivityTab().getThemeColor()
); |
1420 } | 1420 } |
1421 } | 1421 } |
1422 | 1422 |
1423 @Override | 1423 @Override |
1424 protected void setStatusBarColor(Tab tab, int color) { | 1424 protected void setStatusBarColor(Tab tab, int color) { |
1425 super.setStatusBarColor(tab, isInOverviewMode() ? Color.BLACK : color); | 1425 super.setStatusBarColor(tab, isInOverviewMode() ? Color.BLACK : color); |
1426 } | 1426 } |
1427 } | 1427 } |
OLD | NEW |