| Index: chrome/browser/android/data_usage/external_data_use_observer_bridge.cc
|
| diff --git a/chrome/browser/android/data_usage/external_data_use_observer_bridge.cc b/chrome/browser/android/data_usage/external_data_use_observer_bridge.cc
|
| index 01f57f4fc9366e3da0a15c7a53a07ad7c32434c3..ca929ed417d0e3e3ae84c2e54879dfc608e8cff4 100644
|
| --- a/chrome/browser/android/data_usage/external_data_use_observer_bridge.cc
|
| +++ b/chrome/browser/android/data_usage/external_data_use_observer_bridge.cc
|
| @@ -61,7 +61,8 @@ namespace android {
|
|
|
| ExternalDataUseObserverBridge::ExternalDataUseObserverBridge()
|
| : construct_time_(base::TimeTicks::Now()),
|
| - is_first_matching_rule_fetch_(true) {
|
| + is_first_matching_rule_fetch_(true),
|
| + register_google_variation_id_(false) {
|
| DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
|
|
|
| // Detach from IO thread since rest of ExternalDataUseObserverBridge lives on
|
| @@ -210,7 +211,11 @@ void ExternalDataUseObserverBridge::ShouldRegisterAsDataUseObserver(
|
| base::Bind(&ExternalDataUseObserver::ShouldRegisterAsDataUseObserver,
|
| external_data_use_observer_, should_register));
|
|
|
| + if (!register_google_variation_id_)
|
| + return;
|
| +
|
| variations::VariationID variation_id = GetGoogleVariationID();
|
| +
|
| if (variation_id != variations::EMPTY_ID) {
|
| // Set variation id for the enabled group if |should_register| is true.
|
| // Otherwise clear the variation id for the enabled group by setting to
|
| @@ -226,6 +231,12 @@ void ExternalDataUseObserverBridge::ShouldRegisterAsDataUseObserver(
|
| }
|
| }
|
|
|
| +void ExternalDataUseObserverBridge::SetRegisterGoogleVariationID(
|
| + bool register_google_variation_id) {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| + register_google_variation_id_ = register_google_variation_id;
|
| +}
|
| +
|
| bool RegisterExternalDataUseObserver(JNIEnv* env) {
|
| return RegisterNativesImpl(env);
|
| }
|
|
|