help_app_manager.cc 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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. #include "ash/webui/help_app_ui/help_app_manager.h"
  5. #include "ash/webui/help_app_ui/search/search_handler.h"
  6. #include "ash/webui/help_app_ui/search/search_tag_registry.h"
  7. #include "base/bind.h"
  8. #include "base/feature_list.h"
  9. #include "content/public/browser/web_ui_data_source.h"
  10. namespace ash {
  11. namespace help_app {
  12. HelpAppManager::HelpAppManager(
  13. local_search_service::LocalSearchServiceProxy* local_search_service_proxy)
  14. : search_tag_registry_(
  15. std::make_unique<SearchTagRegistry>(local_search_service_proxy)),
  16. search_handler_(
  17. std::make_unique<SearchHandler>(search_tag_registry_.get(),
  18. local_search_service_proxy)) {}
  19. HelpAppManager::~HelpAppManager() = default;
  20. void HelpAppManager::Shutdown() {
  21. // Note: These must be deleted in the opposite order of their creation to
  22. // prevent against UAF violations.
  23. search_handler_.reset();
  24. search_tag_registry_.reset();
  25. }
  26. } // namespace help_app
  27. } // namespace ash