| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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.instantapps; | 5 package org.chromium.chrome.browser.instantapps; |
| 6 | 6 |
| 7 import android.content.Context; | 7 import android.content.Context; |
| 8 import android.content.Intent; | 8 import android.content.Intent; |
| 9 import android.net.Uri; | 9 import android.net.Uri; |
| 10 import android.os.StrictMode; | 10 import android.os.StrictMode; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 * A histogram to record how long the GMS Core API call took when the instan
t app was not found. | 98 * A histogram to record how long the GMS Core API call took when the instan
t app was not found. |
| 99 */ | 99 */ |
| 100 private static final TimesHistogramSample sInstantAppsApiCallTimesNoApp = | 100 private static final TimesHistogramSample sInstantAppsApiCallTimesNoApp = |
| 101 new TimesHistogramSample("Android.InstantApps.ApiCallDurationWithout
App", | 101 new TimesHistogramSample("Android.InstantApps.ApiCallDurationWithout
App", |
| 102 TimeUnit.MILLISECONDS); | 102 TimeUnit.MILLISECONDS); |
| 103 | 103 |
| 104 /** @return The singleton instance of {@link InstantAppsHandler}. */ | 104 /** @return The singleton instance of {@link InstantAppsHandler}. */ |
| 105 public static InstantAppsHandler getInstance() { | 105 public static InstantAppsHandler getInstance() { |
| 106 synchronized (INSTANCE_LOCK) { | 106 synchronized (INSTANCE_LOCK) { |
| 107 if (sInstance == null) { | 107 if (sInstance == null) { |
| 108 Context appContext = ContextUtils.getApplicationContext(); | 108 sInstance = ChromeApplication.createObject(InstantAppsHandler.cl
ass); |
| 109 sInstance = ((ChromeApplication) appContext).createInstantAppsHa
ndler(); | |
| 110 } | 109 } |
| 111 } | 110 } |
| 112 return sInstance; | 111 return sInstance; |
| 113 } | 112 } |
| 114 | 113 |
| 115 /** | 114 /** |
| 116 * Check the cached value to figure out if the feature is enabled. We have t
o use the cached | 115 * Check the cached value to figure out if the feature is enabled. We have t
o use the cached |
| 117 * value because native library hasn't yet been loaded. | 116 * value because native library hasn't yet been loaded. |
| 118 * @param context The application context. | 117 * @param context The application context. |
| 119 * @return Whether the feature is enabled. | 118 * @return Whether the feature is enabled. |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 /** | 351 /** |
| 353 * Gets the instant app intent for the given URL if one exists. | 352 * Gets the instant app intent for the given URL if one exists. |
| 354 * | 353 * |
| 355 * @param url The URL whose instant app this is associated with. | 354 * @param url The URL whose instant app this is associated with. |
| 356 * @return An instant app intent for the URL if one exists. | 355 * @return An instant app intent for the URL if one exists. |
| 357 */ | 356 */ |
| 358 public Intent getInstantAppIntentForUrl(String url) { | 357 public Intent getInstantAppIntentForUrl(String url) { |
| 359 return null; | 358 return null; |
| 360 } | 359 } |
| 361 } | 360 } |
| OLD | NEW |