web_ui_controller_factory.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright (c) 2013 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-CHROMIUM file.
  4. #ifndef BRIGHTRAY_BROWSER_WEB_UI_CONTROLLER_FACTORY_H_
  5. #define BRIGHTRAY_BROWSER_WEB_UI_CONTROLLER_FACTORY_H_
  6. #include "base/macros.h"
  7. #include "content/public/browser/web_ui.h"
  8. #include "content/public/browser/web_ui_controller_factory.h"
  9. namespace base {
  10. template <typename T>
  11. struct DefaultSingletonTraits;
  12. }
  13. namespace brightray {
  14. class BrowserContext;
  15. class WebUIControllerFactory : public content::WebUIControllerFactory {
  16. public:
  17. static WebUIControllerFactory* GetInstance();
  18. WebUIControllerFactory();
  19. ~WebUIControllerFactory() override;
  20. content::WebUI::TypeID GetWebUIType(content::BrowserContext* browser_context,
  21. const GURL& url) const override;
  22. bool UseWebUIForURL(content::BrowserContext* browser_context,
  23. const GURL& url) const override;
  24. bool UseWebUIBindingsForURL(content::BrowserContext* browser_context,
  25. const GURL& url) const override;
  26. content::WebUIController* CreateWebUIControllerForURL(
  27. content::WebUI* web_ui,
  28. const GURL& url) const override;
  29. private:
  30. friend struct base::DefaultSingletonTraits<WebUIControllerFactory>;
  31. DISALLOW_COPY_AND_ASSIGN(WebUIControllerFactory);
  32. };
  33. } // namespace brightray
  34. #endif // BRIGHTRAY_BROWSER_WEB_UI_CONTROLLER_FACTORY_H_