summaryrefslogtreecommitdiff
path: root/chromium/components/variations/variations_client.h
blob: bdfa3bd1ea0990651a719080e85a622a4c7ffab9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_VARIATIONS_VARIATIONS_CLIENT_H_
#define COMPONENTS_VARIATIONS_VARIATIONS_CLIENT_H_

#include "components/variations/variations.mojom.h"

namespace variations {

// Used by VariationsURLLoaderThrottle to insulate the content layer from
// concepts like user sign in which don't belong there. There is an instance per
// profile, so there can be multiple clients at a time when in multi user mode.
class VariationsClient {
 public:
  virtual ~VariationsClient() = default;

  // Returns whether the user is operating in an OffTheRecord context.
  // Note components/variations code can't call the BrowserContext method
  // directly or we'd end up with a circular dependency.
  virtual bool IsOffTheRecord() const = 0;

  // Returns the variations headers that may be appended to eligible requests
  // to Google web properties. For more details, see GetClientDataHeaders() in
  // variations_ids_provider.h.
  virtual variations::mojom::VariationsHeadersPtr GetVariationsHeaders()
      const = 0;
};

}  // namespace variations

#endif  // COMPONENTS_VARIATIONS_VARIATIONS_CLIENT_H_