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; | 5 package org.chromium.chrome.browser; |
6 | 6 |
7 import android.app.Activity; | 7 import android.app.Activity; |
8 import android.app.Application; | 8 import android.app.Application; |
9 import android.content.SharedPreferences; | 9 import android.content.SharedPreferences; |
10 import android.provider.Settings; | 10 import android.provider.Settings; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
76 /** | 76 /** |
77 * Asynchronously returns the value of the "restrict" URL param that the var iations service | 77 * Asynchronously returns the value of the "restrict" URL param that the var iations service |
78 * should use for variation seed requests. | 78 * should use for variation seed requests. |
79 * @param callback Callback that will be called with the param value when av ailable. | 79 * @param callback Callback that will be called with the param value when av ailable. |
80 */ | 80 */ |
81 public void getVariationsRestrictModeValue(Callback<String> callback) { | 81 public void getVariationsRestrictModeValue(Callback<String> callback) { |
82 mVariationsSession.getRestrictModeValue(mApplication, callback); | 82 mVariationsSession.getRestrictModeValue(mApplication, callback); |
83 } | 83 } |
84 | 84 |
85 /** | 85 /** |
86 * @return The latest country according to the current variations state. | |
Alexei Svitkine (slow)
2017/04/20 16:35:41
Update this comment to mention null too.
gone
2017/04/20 16:38:37
Oh, good point... Mark this @Nullable.
Yusuf
2017/04/20 18:16:13
Done.
| |
87 */ | |
88 public String getVariationsLatestCountry() { | |
89 return mVariationsSession.getLatestCountry(); | |
90 } | |
91 | |
92 /** | |
86 * Handle any initialization that occurs once native has been loaded. | 93 * Handle any initialization that occurs once native has been loaded. |
87 */ | 94 */ |
88 public void initializeWithNative() { | 95 public void initializeWithNative() { |
89 ThreadUtils.assertOnUiThread(); | 96 ThreadUtils.assertOnUiThread(); |
90 | 97 |
91 if (mIsInitialized) return; | 98 if (mIsInitialized) return; |
92 mIsInitialized = true; | 99 mIsInitialized = true; |
93 assert !mIsStarted; | 100 assert !mIsStarted; |
94 | 101 |
95 ApplicationStatus.registerApplicationStateListener(createApplicationStat eListener()); | 102 ApplicationStatus.registerApplicationStateListener(createApplicationStat eListener()); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
245 } | 252 } |
246 | 253 |
247 /** | 254 /** |
248 * @return The PowerBroadcastReceiver for the browser process. | 255 * @return The PowerBroadcastReceiver for the browser process. |
249 */ | 256 */ |
250 @VisibleForTesting | 257 @VisibleForTesting |
251 public PowerBroadcastReceiver getPowerBroadcastReceiverForTesting() { | 258 public PowerBroadcastReceiver getPowerBroadcastReceiverForTesting() { |
252 return mPowerBroadcastReceiver; | 259 return mPowerBroadcastReceiver; |
253 } | 260 } |
254 } | 261 } |
OLD | NEW |