tab_url_provider.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // Copyright 2021 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_OPTIMIZATION_GUIDE_CORE_TAB_URL_PROVIDER_H_
  5. #define COMPONENTS_OPTIMIZATION_GUIDE_CORE_TAB_URL_PROVIDER_H_
  6. #include <vector>
  7. #include "base/time/time.h"
  8. #include "url/gurl.h"
  9. namespace optimization_guide {
  10. // A class to handle querying for the tab URLs for a user.
  11. class TabUrlProvider {
  12. public:
  13. virtual ~TabUrlProvider() = default;
  14. TabUrlProvider(const TabUrlProvider&) = delete;
  15. TabUrlProvider& operator=(const TabUrlProvider&) = delete;
  16. // Returns URLS of tabs that are considered active for the user, as
  17. // represented by |profile|. Tabs are considered active if they were last
  18. // shown within |duration_since_last_shown|. The returned vector will be
  19. // sorted by descending time since last shown.
  20. virtual const std::vector<GURL> GetUrlsOfActiveTabs(
  21. const base::TimeDelta& duration_since_last_shown) = 0;
  22. protected:
  23. TabUrlProvider() = default;
  24. };
  25. } // namespace optimization_guide
  26. #endif // COMPONENTS_OPTIMIZATION_GUIDE_CORE_TAB_URL_PROVIDER_H_