help_app_manager.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 ASH_WEBUI_HELP_APP_UI_HELP_APP_MANAGER_H_
  5. #define ASH_WEBUI_HELP_APP_UI_HELP_APP_MANAGER_H_
  6. // TODO(https://crbug.com/1164001): remove and use forward declaration.
  7. #include "chromeos/ash/components/local_search_service/public/cpp/local_search_service_proxy.h"
  8. #include "components/keyed_service/core/keyed_service.h"
  9. #include <memory>
  10. namespace ash {
  11. namespace help_app {
  12. class SearchHandler;
  13. class SearchTagRegistry;
  14. // Manager for the Chrome OS help app. This class is implemented as a
  15. // KeyedService, so one instance of the class is intended to be active for the
  16. // lifetime of a logged-in user, even if the help app is not opened.
  17. //
  18. // Main responsibilities:
  19. //
  20. // (1) Support search queries for help content. HelpAppManager is
  21. // responsible for updating the kHelpAppLauncher index of the
  22. // LocalSearchService with search tags corresponding to the top help
  23. // articles.
  24. class HelpAppManager : public KeyedService {
  25. public:
  26. HelpAppManager(local_search_service::LocalSearchServiceProxy*
  27. local_search_service_proxy);
  28. HelpAppManager(const HelpAppManager& other) = delete;
  29. HelpAppManager& operator=(const HelpAppManager& other) = delete;
  30. ~HelpAppManager() override;
  31. SearchHandler* search_handler() { return search_handler_.get(); }
  32. private:
  33. // KeyedService:
  34. void Shutdown() override;
  35. std::unique_ptr<SearchTagRegistry> search_tag_registry_;
  36. std::unique_ptr<SearchHandler> search_handler_;
  37. };
  38. } // namespace help_app
  39. } // namespace ash
  40. #endif // ASH_WEBUI_HELP_APP_UI_HELP_APP_MANAGER_H_