| 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 1591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1602 * See VrShellDelegate#isVrShellEnabled() | 1602 * See VrShellDelegate#isVrShellEnabled() |
| 1603 */ | 1603 */ |
| 1604 @Override | 1604 @Override |
| 1605 public boolean isVrShellEnabled() { | 1605 public boolean isVrShellEnabled() { |
| 1606 return mVrShellDelegate.isVrShellEnabled(); | 1606 return mVrShellDelegate.isVrShellEnabled(); |
| 1607 } | 1607 } |
| 1608 | 1608 |
| 1609 // TODO(mthiesse): Toggle toolbar overlay, popups, etc. | 1609 // TODO(mthiesse): Toggle toolbar overlay, popups, etc. |
| 1610 public void setUIVisibilityForVR(int visibility) { | 1610 public void setUIVisibilityForVR(int visibility) { |
| 1611 mControlContainer.setVisibility(visibility); | 1611 mControlContainer.setVisibility(visibility); |
| 1612 getCompositorViewHolder().getSurfaceView().setVisibility(visibility); | 1612 getCompositorViewHolder().getCompositorView().setVisibility(visibility); |
| 1613 getCompositorViewHolder().setVisibility(visibility); | 1613 getCompositorViewHolder().setVisibility(visibility); |
| 1614 } | 1614 } |
| 1615 | 1615 |
| 1616 /** | 1616 /** |
| 1617 * Reports that a new tab launcher shortcut was selected or an action equiva
lent to a shortcut | 1617 * Reports that a new tab launcher shortcut was selected or an action equiva
lent to a shortcut |
| 1618 * was performed. | 1618 * was performed. |
| 1619 * @param isIncognito Whether the shortcut or action created a new incognito
tab. | 1619 * @param isIncognito Whether the shortcut or action created a new incognito
tab. |
| 1620 */ | 1620 */ |
| 1621 @TargetApi(25) | 1621 @TargetApi(25) |
| 1622 private void reportNewTabShortcutUsed(boolean isIncognito) { | 1622 private void reportNewTabShortcutUsed(boolean isIncognito) { |
| 1623 if (!BuildInfo.isGreaterThanN()) return; | 1623 if (!BuildInfo.isGreaterThanN()) return; |
| 1624 | 1624 |
| 1625 try { | 1625 try { |
| 1626 Class<?> clazz = Class.forName("android.content.pm.ShortcutManager")
; | 1626 Class<?> clazz = Class.forName("android.content.pm.ShortcutManager")
; |
| 1627 Method method = clazz.getDeclaredMethod("reportShortcutUsed", String
.class); | 1627 Method method = clazz.getDeclaredMethod("reportShortcutUsed", String
.class); |
| 1628 method.invoke(getSystemService(clazz), | 1628 method.invoke(getSystemService(clazz), |
| 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 |