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.TargetApi; | 7 import android.annotation.TargetApi; |
8 import android.app.Activity; | 8 import android.app.Activity; |
9 import android.app.ActivityManager; | 9 import android.app.ActivityManager; |
10 import android.content.Context; | 10 import android.content.Context; |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 | 409 |
410 if (FeatureUtilities.isTabModelMergingEnabled()) { | 410 if (FeatureUtilities.isTabModelMergingEnabled()) { |
411 boolean inMultiWindowMode = MultiWindowUtils.getInstance().isInMulti
WindowMode(this); | 411 boolean inMultiWindowMode = MultiWindowUtils.getInstance().isInMulti
WindowMode(this); |
412 // Merge tabs if the activity is not in multi-window mode and mMerge
TabsOnResume is true | 412 // Merge tabs if the activity is not in multi-window mode and mMerge
TabsOnResume is true |
413 // or unset because the activity is just starting or was destroyed. | 413 // or unset because the activity is just starting or was destroyed. |
414 if (!inMultiWindowMode && (mMergeTabsOnResume == null || mMergeTabsO
nResume)) { | 414 if (!inMultiWindowMode && (mMergeTabsOnResume == null || mMergeTabsO
nResume)) { |
415 maybeMergeTabs(); | 415 maybeMergeTabs(); |
416 } | 416 } |
417 mMergeTabsOnResume = false; | 417 mMergeTabsOnResume = false; |
418 } | 418 } |
419 if (mVrShellDelegate.isInVR()) mVrShellDelegate.resumeVR(); | 419 mVrShellDelegate.maybeResumeVR(); |
420 | 420 |
421 mLocaleManager.setSnackbarManager(getSnackbarManager()); | 421 mLocaleManager.setSnackbarManager(getSnackbarManager()); |
422 mLocaleManager.startObservingPhoneChanges(); | 422 mLocaleManager.startObservingPhoneChanges(); |
423 } | 423 } |
424 | 424 |
425 @Override | 425 @Override |
426 public void onPauseWithNative() { | 426 public void onPauseWithNative() { |
427 mTabModelSelectorImpl.commitAllTabClosures(); | 427 mTabModelSelectorImpl.commitAllTabClosures(); |
428 CookiesFetcher.persistCookies(this); | 428 CookiesFetcher.persistCookies(this); |
429 if (mVrShellDelegate.isInVR()) mVrShellDelegate.pauseVR(); | 429 mVrShellDelegate.maybePauseVR(); |
430 | 430 |
431 mLocaleManager.setSnackbarManager(null); | 431 mLocaleManager.setSnackbarManager(null); |
432 mLocaleManager.stopObservingPhoneChanges(); | 432 mLocaleManager.stopObservingPhoneChanges(); |
433 | 433 |
434 super.onPauseWithNative(); | 434 super.onPauseWithNative(); |
435 } | 435 } |
436 | 436 |
437 @Override | 437 @Override |
438 public void onStopWithNative() { | 438 public void onStopWithNative() { |
439 super.onStopWithNative(); | 439 super.onStopWithNative(); |
(...skipping 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1629 isIncognito ? "new-incognito-tab-shortcut" : "new-tab-shortc
ut"); | 1629 isIncognito ? "new-incognito-tab-shortcut" : "new-tab-shortc
ut"); |
1630 } catch (Exception e) { | 1630 } catch (Exception e) { |
1631 e.printStackTrace(); | 1631 e.printStackTrace(); |
1632 } | 1632 } |
1633 } | 1633 } |
1634 | 1634 |
1635 public VrShellDelegate getVrShellDelegate() { | 1635 public VrShellDelegate getVrShellDelegate() { |
1636 return mVrShellDelegate; | 1636 return mVrShellDelegate; |
1637 } | 1637 } |
1638 } | 1638 } |
OLD | NEW |