variations_client.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2020 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_VARIATIONS_VARIATIONS_CLIENT_H_
  5. #define COMPONENTS_VARIATIONS_VARIATIONS_CLIENT_H_
  6. #include "base/component_export.h"
  7. #include "components/variations/variations.mojom.h"
  8. namespace variations {
  9. // Used by VariationsURLLoaderThrottle to insulate the content layer from
  10. // concepts like user sign in which don't belong there. There is an instance per
  11. // profile, so there can be multiple clients at a time when in multi user mode.
  12. class COMPONENT_EXPORT(VARIATIONS) VariationsClient {
  13. public:
  14. virtual ~VariationsClient() = default;
  15. // Returns whether the user is operating in an OffTheRecord context.
  16. // Note components/variations code can't call the BrowserContext method
  17. // directly or we'd end up with a circular dependency.
  18. virtual bool IsOffTheRecord() const = 0;
  19. // Returns the variations headers that may be appended to eligible requests
  20. // to Google web properties. For more details, see GetClientDataHeaders() in
  21. // variations_ids_provider.h.
  22. virtual variations::mojom::VariationsHeadersPtr GetVariationsHeaders()
  23. const = 0;
  24. };
  25. } // namespace variations
  26. #endif // COMPONENTS_VARIATIONS_VARIATIONS_CLIENT_H_