| OLD | NEW |
| 1 // Copyright 2015 Google Inc. All Rights Reserved. | 1 // Copyright 2015 Google Inc. All Rights Reserved. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 // See the License for the specific language governing permissions and | 12 // See the License for the specific language governing permissions and |
| 13 // limitations under the License. | 13 // limitations under the License. |
| 14 | 14 |
| 15 package org.chromium.customtabsdemos; | 15 package org.chromium.customtabsdemos; |
| 16 | 16 |
| 17 import android.app.Activity; | 17 import android.app.Activity; |
| 18 import android.content.ComponentName; | |
| 19 import android.net.Uri; | 18 import android.net.Uri; |
| 20 import android.os.Bundle; | 19 import android.os.Bundle; |
| 21 import android.support.annotation.NonNull; | |
| 22 import android.support.customtabs.CustomTabsClient; | 20 import android.support.customtabs.CustomTabsClient; |
| 23 import android.support.customtabs.CustomTabsIntent; | 21 import android.support.customtabs.CustomTabsIntent; |
| 24 import android.support.customtabs.CustomTabsServiceConnection; | 22 import android.support.customtabs.CustomTabsServiceConnection; |
| 25 import android.support.customtabs.CustomTabsSession; | 23 import android.support.customtabs.CustomTabsSession; |
| 26 | 24 |
| 27 import org.chromium.customtabsclient.shared.CustomTabsHelper; | 25 import org.chromium.customtabsclient.shared.CustomTabsHelper; |
| 28 import org.chromium.customtabsclient.shared.ServiceConnection; | 26 import org.chromium.customtabsclient.shared.ServiceConnection; |
| 29 import org.chromium.customtabsclient.shared.ServiceConnectionCallback; | 27 import org.chromium.customtabsclient.shared.ServiceConnectionCallback; |
| 30 | 28 |
| 31 import java.lang.ref.WeakReference; | |
| 32 import java.util.List; | 29 import java.util.List; |
| 33 | 30 |
| 34 /** | 31 /** |
| 35 * This is a helper class to manage the connection to the Custom Tabs Service. | 32 * This is a helper class to manage the connection to the Custom Tabs Service. |
| 36 */ | 33 */ |
| 37 public class CustomTabActivityHelper implements ServiceConnectionCallback { | 34 public class CustomTabActivityHelper implements ServiceConnectionCallback { |
| 38 private CustomTabsSession mCustomTabsSession; | 35 private CustomTabsSession mCustomTabsSession; |
| 39 private CustomTabsClient mClient; | 36 private CustomTabsClient mClient; |
| 40 private CustomTabsServiceConnection mConnection; | 37 private CustomTabsServiceConnection mConnection; |
| 41 private ConnectionCallback mConnectionCallback; | 38 private ConnectionCallback mConnectionCallback; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 public interface CustomTabFallback { | 160 public interface CustomTabFallback { |
| 164 /** | 161 /** |
| 165 * | 162 * |
| 166 * @param activity The Activity that wants to open the Uri. | 163 * @param activity The Activity that wants to open the Uri. |
| 167 * @param uri The uri to be opened by the fallback. | 164 * @param uri The uri to be opened by the fallback. |
| 168 */ | 165 */ |
| 169 void openUri(Activity activity, Uri uri); | 166 void openUri(Activity activity, Uri uri); |
| 170 } | 167 } |
| 171 | 168 |
| 172 } | 169 } |
| OLD | NEW |