tile_types.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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_QUERY_TILES_INTERNAL_TILE_TYPES_H_
  5. #define COMPONENTS_QUERY_TILES_INTERNAL_TILE_TYPES_H_
  6. #include "base/callback.h"
  7. // Please keep the same order as QueryTilesRequestStatus enum in
  8. // tools/metrics/histograms/enums.xml.
  9. enum class TileInfoRequestStatus {
  10. // Initial status, request is not sent.
  11. kInit = 0,
  12. // Request completed successfully.
  13. kSuccess = 1,
  14. // Request failed. Suggesting a retry with backoff.
  15. kFailure = 2,
  16. // Request failed, suggesting a suspend.
  17. kShouldSuspend = 3,
  18. // Max value.
  19. kMaxValue = kShouldSuspend,
  20. };
  21. // Please keep the same order as QueryTilesGroupStatus enum in
  22. // tools/metrics/histograms/enums.xml.
  23. enum class TileGroupStatus {
  24. // No errors happen in tile group manager.
  25. kSuccess = 0,
  26. // Database and manager component is not fully initialized.
  27. kUninitialized = 1,
  28. // Db operations failed.
  29. kFailureDbOperation = 2,
  30. // Group data has been expired or hasn't been downloaded yet.
  31. kNoTiles = 3,
  32. // Max value.
  33. kMaxValue = kNoTiles,
  34. };
  35. // Config to control how tile images are prefetched in background task.
  36. enum class ImagePrefetchMode {
  37. // No images will be prefetched.
  38. kNone = 0,
  39. // Only the top level images are prefetched.
  40. kTopLevel = 1,
  41. // All tile images are prefetched.
  42. kAll = 2,
  43. kMaxValue = kAll
  44. };
  45. using SuccessCallback = base::OnceCallback<void(bool)>;
  46. #endif // COMPONENTS_QUERY_TILES_INTERNAL_TILE_TYPES_H_