variations_seed_bridge.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright 2015 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_ANDROID_VARIATIONS_SEED_BRIDGE_H_
  5. #define COMPONENTS_VARIATIONS_ANDROID_VARIATIONS_SEED_BRIDGE_H_
  6. #include <jni.h>
  7. #include <string>
  8. #include "base/component_export.h"
  9. #include "components/variations/seed_response.h"
  10. namespace variations {
  11. namespace android {
  12. // Return the first run seed data pulled from the Java side of application.
  13. COMPONENT_EXPORT(VARIATIONS)
  14. std::unique_ptr<variations::SeedResponse> GetVariationsFirstRunSeed();
  15. // Clears first run seed preferences stored on the Java side of Chrome for
  16. // Android.
  17. COMPONENT_EXPORT(VARIATIONS) void ClearJavaFirstRunPrefs();
  18. // Marks variations seed as stored to avoid repeated fetches of the seed at
  19. // the Java side.
  20. COMPONENT_EXPORT(VARIATIONS) void MarkVariationsSeedAsStored();
  21. // Sets test data on the Java side. The data is pulled during the unit tests to
  22. // C++ side and is being checked for consistency.
  23. // This method is used for unit testing purposes only.
  24. COMPONENT_EXPORT(VARIATIONS)
  25. void SetJavaFirstRunPrefsForTesting(const std::string& seed_data,
  26. const std::string& seed_signature,
  27. const std::string& seed_country,
  28. long response_date,
  29. bool is_gzip_compressed);
  30. COMPONENT_EXPORT(VARIATIONS) bool HasMarkedPrefsForTesting();
  31. } // namespace android
  32. } // namespace variations
  33. #endif // COMPONENTS_VARIATIONS_ANDROID_VARIATIONS_SEED_BRIDGE_H_