| 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.init; | 5 package org.chromium.chrome.browser.init; |
| 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.content.Context; | 10 import android.content.Context; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 @Override | 95 @Override |
| 96 @TargetApi(Build.VERSION_CODES.N) | 96 @TargetApi(Build.VERSION_CODES.N) |
| 97 protected void attachBaseContext(Context newBase) { | 97 protected void attachBaseContext(Context newBase) { |
| 98 super.attachBaseContext(newBase); | 98 super.attachBaseContext(newBase); |
| 99 | 99 |
| 100 // On N+, Chrome should always retain the tab strip layout on tablets. N
ormally in | 100 // On N+, Chrome should always retain the tab strip layout on tablets. N
ormally in |
| 101 // multi-window, if Chrome is launched into a smaller screen Android wil
l load the tab | 101 // multi-window, if Chrome is launched into a smaller screen Android wil
l load the tab |
| 102 // switcher resources. Overriding the smallestScreenWidthDp in the Confi
guration ensures | 102 // switcher resources. Overriding the smallestScreenWidthDp in the Confi
guration ensures |
| 103 // Android will load the tab strip resources. See crbug.com/588838. | 103 // Android will load the tab strip resources. See crbug.com/588838. |
| 104 if (Build.VERSION.CODENAME.equals("N") || Build.VERSION.SDK_INT > Build.
VERSION_CODES.M) { | 104 if (Build.VERSION.CODENAME.equals("N") || Build.VERSION.SDK_INT > Build.
VERSION_CODES.M) { |
| 105 int smallestDeviceWidthDp = DeviceFormFactor.getSmallestDeviceWidthD
p(this); | 105 int smallestDeviceWidthDp = DeviceFormFactor.getSmallestDeviceWidthD
p(); |
| 106 | 106 |
| 107 if (smallestDeviceWidthDp >= DeviceFormFactor.MINIMUM_TABLET_WIDTH_D
P) { | 107 if (smallestDeviceWidthDp >= DeviceFormFactor.MINIMUM_TABLET_WIDTH_D
P) { |
| 108 Configuration overrideConfiguration = new Configuration(); | 108 Configuration overrideConfiguration = new Configuration(); |
| 109 overrideConfiguration.smallestScreenWidthDp = smallestDeviceWidt
hDp; | 109 overrideConfiguration.smallestScreenWidthDp = smallestDeviceWidt
hDp; |
| 110 applyOverrideConfiguration(overrideConfiguration); | 110 applyOverrideConfiguration(overrideConfiguration); |
| 111 } | 111 } |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 | 114 |
| 115 @Override | 115 @Override |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 getDecorView().setVisibility(View.GONE); | 649 getDecorView().setVisibility(View.GONE); |
| 650 } | 650 } |
| 651 getViewTreeObserver().removeOnPreDrawListener(mPreDrawLi
stener); | 651 getViewTreeObserver().removeOnPreDrawListener(mPreDrawLi
stener); |
| 652 } | 652 } |
| 653 }); | 653 }); |
| 654 return true; | 654 return true; |
| 655 } | 655 } |
| 656 }; | 656 }; |
| 657 } | 657 } |
| 658 } | 658 } |
| OLD | NEW |