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.KeyguardManager; | 7 import android.app.KeyguardManager; |
8 import android.app.PendingIntent; | 8 import android.app.PendingIntent; |
9 import android.app.SearchManager; | 9 import android.app.SearchManager; |
10 import android.content.ComponentName; | 10 import android.content.ComponentName; |
(...skipping 692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 | 703 |
704 PendingIntent token = fetchAuthenticationTokenFromIntent(intent); | 704 PendingIntent token = fetchAuthenticationTokenFromIntent(intent); |
705 if (token == null) return false; | 705 if (token == null) return false; |
706 | 706 |
707 // Do not ignore a valid URL Intent if the sender is Chrome. (If the Pen
dingIntents are | 707 // Do not ignore a valid URL Intent if the sender is Chrome. (If the Pen
dingIntents are |
708 // equal, we know that the sender was us.) | 708 // equal, we know that the sender was us.) |
709 if (isChromeToken(token, context)) { | 709 if (isChromeToken(token, context)) { |
710 return true; | 710 return true; |
711 } | 711 } |
712 if (ExternalAuthUtils.getInstance().isGoogleSigned( | 712 if (ExternalAuthUtils.getInstance().isGoogleSigned( |
713 context.getPackageManager(), ApiCompatibilityUtils.getCreato
rPackage(token))) { | 713 context, ApiCompatibilityUtils.getCreatorPackage(token))) { |
714 return true; | 714 return true; |
715 } | 715 } |
716 return false; | 716 return false; |
717 } | 717 } |
718 | 718 |
719 private boolean isIntentUserVisible(Context context) { | 719 private boolean isIntentUserVisible(Context context) { |
720 // Only process Intents if the screen is on and the device is unlocked; | 720 // Only process Intents if the screen is on and the device is unlocked; |
721 // i.e. the user will see what is going on. | 721 // i.e. the user will see what is going on. |
722 if (mKeyguardManager == null) { | 722 if (mKeyguardManager == null) { |
723 mKeyguardManager = (KeyguardManager) context.getSystemService(Contex
t.KEYGUARD_SERVICE); | 723 mKeyguardManager = (KeyguardManager) context.getSystemService(Contex
t.KEYGUARD_SERVICE); |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
903 if (transitionType == PageTransition.TYPED) { | 903 if (transitionType == PageTransition.TYPED) { |
904 return transitionType; | 904 return transitionType; |
905 } else if (transitionType != PageTransition.LINK | 905 } else if (transitionType != PageTransition.LINK |
906 && isIntentChromeOrFirstParty(intent, context)) { | 906 && isIntentChromeOrFirstParty(intent, context)) { |
907 // 1st party applications may specify any transition type. | 907 // 1st party applications may specify any transition type. |
908 return transitionType; | 908 return transitionType; |
909 } | 909 } |
910 return defaultTransition; | 910 return defaultTransition; |
911 } | 911 } |
912 } | 912 } |
OLD | NEW |