Commit 6c2eff7c authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

weblayer: fix X-Client-Data header sending

There were two issues:
. Need to register the VariationsIdsProvider with the trial-registry.
  Without this the header content is never updated.
. Need to return true from VariationsClient::IsSignedIn(). This is
  needed as registerExternalExperimentIDs() supplies SignedIn.

I clearly need a test for this. Will add it in a follow up.

BUG=11478276
TEST=none

Change-Id: I62b6976dd51c3eb3aff4412ee2512b7c5516301b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2532516Reviewed-by: default avatarAlexei Svitkine <asvitkine@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826834}
parent 11031657
......@@ -15,6 +15,7 @@
#include "components/metrics/metrics_provider.h"
#include "components/metrics/metrics_service.h"
#include "components/page_load_metrics/browser/metrics_web_contents_observer.h"
#include "components/variations/variations_ids_provider.h"
#include "components/version_info/android/channel_getter.h"
#include "content/public/browser/browser_context.h"
#include "google_apis/google_api_keys.h"
......@@ -140,6 +141,8 @@ void WebLayerMetricsServiceClient::OnMetricsStart() {
std::move(task).Run();
}
post_start_tasks_.clear();
GetMetricsService()->synthetic_trial_registry()->AddSyntheticTrialObserver(
variations::VariationsIdsProvider::GetInstance());
}
void WebLayerMetricsServiceClient::OnMetricsNotStarted() {
......
......@@ -306,10 +306,13 @@ class BrowserContextImpl::WebLayerVariationsClient
}
private:
bool IsSignedIn() const {
// TODO(weblayer-dev): Update when signin is supported.
return false;
}
// Signed-in state shouldn't control the set of variations for WebLayer,
// so this always returns true. This is particularly experiment for
// registering external experiment ids, which are registered assuming
// signed-in.
// TODO(sky): this is rather misleading, and needs to be resolved. Figure
// out right long term solution.
bool IsSignedIn() const { return true; }
content::BrowserContext* browser_context_;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment