atom_web_ui_controller_factory.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright (c) 2017 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ATOM_BROWSER_ATOM_WEB_UI_CONTROLLER_FACTORY_H_
  5. #define ATOM_BROWSER_ATOM_WEB_UI_CONTROLLER_FACTORY_H_
  6. #include "base/macros.h"
  7. #include "base/memory/singleton.h"
  8. #include "content/public/browser/web_ui_controller_factory.h"
  9. namespace atom {
  10. class AtomWebUIControllerFactory : public content::WebUIControllerFactory {
  11. public:
  12. static AtomWebUIControllerFactory* GetInstance();
  13. AtomWebUIControllerFactory();
  14. ~AtomWebUIControllerFactory() override;
  15. // content::WebUIControllerFactory:
  16. content::WebUI::TypeID GetWebUIType(content::BrowserContext* browser_context,
  17. const GURL& url) const override;
  18. bool UseWebUIForURL(content::BrowserContext* browser_context,
  19. const GURL& url) const override;
  20. bool UseWebUIBindingsForURL(content::BrowserContext* browser_context,
  21. const GURL& url) const override;
  22. content::WebUIController* CreateWebUIControllerForURL(
  23. content::WebUI* web_ui,
  24. const GURL& url) const override;
  25. private:
  26. friend struct base::DefaultSingletonTraits<AtomWebUIControllerFactory>;
  27. DISALLOW_COPY_AND_ASSIGN(AtomWebUIControllerFactory);
  28. };
  29. } // namespace atom
  30. #endif // ATOM_BROWSER_ATOM_WEB_UI_CONTROLLER_FACTORY_H_