aw_web_ui_controller_factory.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright 2017 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 ANDROID_WEBVIEW_BROWSER_AW_WEB_UI_CONTROLLER_FACTORY_H_
  5. #define ANDROID_WEBVIEW_BROWSER_AW_WEB_UI_CONTROLLER_FACTORY_H_
  6. #include "base/memory/singleton.h"
  7. #include "content/public/browser/web_ui_controller_factory.h"
  8. namespace android_webview {
  9. class AwWebUIControllerFactory : public content::WebUIControllerFactory {
  10. public:
  11. static AwWebUIControllerFactory* GetInstance();
  12. AwWebUIControllerFactory(const AwWebUIControllerFactory&) = delete;
  13. AwWebUIControllerFactory& operator=(const AwWebUIControllerFactory&) = delete;
  14. // content::WebUIControllerFactory overrides
  15. content::WebUI::TypeID GetWebUIType(content::BrowserContext* browser_context,
  16. const GURL& url) override;
  17. bool UseWebUIForURL(content::BrowserContext* browser_context,
  18. const GURL& url) override;
  19. std::unique_ptr<content::WebUIController> CreateWebUIControllerForURL(
  20. content::WebUI* web_ui,
  21. const GURL& url) override;
  22. private:
  23. friend struct base::DefaultSingletonTraits<AwWebUIControllerFactory>;
  24. AwWebUIControllerFactory();
  25. ~AwWebUIControllerFactory() override;
  26. };
  27. } // namespace android_webview
  28. #endif // ANDROID_WEBVIEW_BROWSER_AW_WEB_UI_CONTROLLER_FACTORY_H_