| 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.content.Context; | 7 import android.content.Context; |
| 8 import android.os.AsyncTask; | 8 import android.os.AsyncTask; |
| 9 import android.text.TextUtils; | 9 import android.text.TextUtils; |
| 10 | 10 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 String customTabsTrialGroupName = FieldTrialList.findFullName("CustomTab
s"); | 113 String customTabsTrialGroupName = FieldTrialList.findFullName("CustomTab
s"); |
| 114 if (customTabsTrialGroupName.equals("Disabled")) { | 114 if (customTabsTrialGroupName.equals("Disabled")) { |
| 115 ChromePreferenceManager.getInstance(application).setCustomTabsEnable
d(false); | 115 ChromePreferenceManager.getInstance(application).setCustomTabsEnable
d(false); |
| 116 } else if (customTabsTrialGroupName.equals("Enabled") | 116 } else if (customTabsTrialGroupName.equals("Enabled") |
| 117 || customTabsTrialGroupName.equals("DisablePrerender")) { | 117 || customTabsTrialGroupName.equals("DisablePrerender")) { |
| 118 ChromePreferenceManager.getInstance(application).setCustomTabsEnable
d(true); | 118 ChromePreferenceManager.getInstance(application).setCustomTabsEnable
d(true); |
| 119 } | 119 } |
| 120 | 120 |
| 121 // Start or stop Physical Web | 121 // Start or stop Physical Web |
| 122 if (PhysicalWeb.shouldStartOnLaunch(application)) { | 122 PhysicalWeb.onChromeStart(application); |
| 123 PhysicalWeb.startPhysicalWeb(application); | |
| 124 PhysicalWeb.uploadDeferredMetrics(application); | |
| 125 } else { | |
| 126 PhysicalWeb.stopPhysicalWeb(application); | |
| 127 } | |
| 128 | 123 |
| 129 mDeferredStartupComplete = true; | 124 mDeferredStartupComplete = true; |
| 130 } | 125 } |
| 131 | 126 |
| 132 private static float parseFloat(String value, float defaultValue) { | 127 private static float parseFloat(String value, float defaultValue) { |
| 133 try { | 128 try { |
| 134 return TextUtils.isEmpty(value) ? defaultValue : Float.parseFloat(va
lue); | 129 return TextUtils.isEmpty(value) ? defaultValue : Float.parseFloat(va
lue); |
| 135 } catch (NumberFormatException e) { | 130 } catch (NumberFormatException e) { |
| 136 return defaultValue; | 131 return defaultValue; |
| 137 } | 132 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 149 } | 144 } |
| 150 | 145 |
| 151 /** | 146 /** |
| 152 * @return Whether deferred startup has been completed. | 147 * @return Whether deferred startup has been completed. |
| 153 */ | 148 */ |
| 154 @VisibleForTesting | 149 @VisibleForTesting |
| 155 public boolean isDeferredStartupComplete() { | 150 public boolean isDeferredStartupComplete() { |
| 156 return mDeferredStartupComplete; | 151 return mDeferredStartupComplete; |
| 157 } | 152 } |
| 158 } | 153 } |
| OLD | NEW |