2017-01-17 14:23:13 +00:00
|
|
|
// Copyright (c) 2017 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2019-06-19 20:56:58 +00:00
|
|
|
#ifndef SHELL_BROWSER_ATOM_WEB_UI_CONTROLLER_FACTORY_H_
|
|
|
|
#define SHELL_BROWSER_ATOM_WEB_UI_CONTROLLER_FACTORY_H_
|
2017-01-17 14:23:13 +00:00
|
|
|
|
2018-10-02 19:11:56 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2017-01-17 14:23:13 +00:00
|
|
|
#include "base/macros.h"
|
|
|
|
#include "base/memory/singleton.h"
|
2018-10-02 19:11:56 +00:00
|
|
|
#include "content/public/browser/web_ui_controller.h"
|
2017-01-17 14:23:13 +00:00
|
|
|
#include "content/public/browser/web_ui_controller_factory.h"
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
namespace electron {
|
2017-01-17 14:23:13 +00:00
|
|
|
|
|
|
|
class AtomWebUIControllerFactory : public content::WebUIControllerFactory {
|
|
|
|
public:
|
|
|
|
static AtomWebUIControllerFactory* GetInstance();
|
|
|
|
|
|
|
|
AtomWebUIControllerFactory();
|
2018-04-17 23:03:51 +00:00
|
|
|
~AtomWebUIControllerFactory() override;
|
2017-01-17 14:23:13 +00:00
|
|
|
|
2017-01-18 13:58:20 +00:00
|
|
|
// content::WebUIControllerFactory:
|
2017-01-17 14:23:13 +00:00
|
|
|
content::WebUI::TypeID GetWebUIType(content::BrowserContext* browser_context,
|
|
|
|
const GURL& url) const override;
|
|
|
|
bool UseWebUIForURL(content::BrowserContext* browser_context,
|
|
|
|
const GURL& url) const override;
|
|
|
|
bool UseWebUIBindingsForURL(content::BrowserContext* browser_context,
|
|
|
|
const GURL& url) const override;
|
2018-10-02 19:11:56 +00:00
|
|
|
std::unique_ptr<content::WebUIController> CreateWebUIControllerForURL(
|
2017-01-17 14:23:13 +00:00
|
|
|
content::WebUI* web_ui,
|
|
|
|
const GURL& url) const override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
friend struct base::DefaultSingletonTraits<AtomWebUIControllerFactory>;
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(AtomWebUIControllerFactory);
|
|
|
|
};
|
|
|
|
|
2019-06-19 21:23:04 +00:00
|
|
|
} // namespace electron
|
2017-01-17 14:23:13 +00:00
|
|
|
|
2019-06-19 20:56:58 +00:00
|
|
|
#endif // SHELL_BROWSER_ATOM_WEB_UI_CONTROLLER_FACTORY_H_
|