2013-05-14 14:45:34 +08:00
|
|
|
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE-CHROMIUM file.
|
|
|
|
|
|
|
|
#ifndef BRIGHTRAY_BROWSER_WEB_UI_CONTROLLER_FACTORY_H_
|
|
|
|
#define BRIGHTRAY_BROWSER_WEB_UI_CONTROLLER_FACTORY_H_
|
|
|
|
|
2016-03-08 10:14:16 +09:00
|
|
|
#include "base/macros.h"
|
2013-05-14 14:45:34 +08:00
|
|
|
#include "content/public/browser/web_ui.h"
|
|
|
|
#include "content/public/browser/web_ui_controller_factory.h"
|
|
|
|
|
2015-12-07 19:55:01 +08:00
|
|
|
namespace base {
|
2018-04-17 21:46:27 -04:00
|
|
|
template <typename T>
|
|
|
|
struct DefaultSingletonTraits;
|
2015-12-07 19:55:01 +08:00
|
|
|
}
|
2015-08-28 01:24:05 +05:30
|
|
|
|
2013-05-14 14:45:34 +08:00
|
|
|
namespace brightray {
|
|
|
|
|
|
|
|
class BrowserContext;
|
|
|
|
|
|
|
|
class WebUIControllerFactory : public content::WebUIControllerFactory {
|
|
|
|
public:
|
2015-08-28 01:24:05 +05:30
|
|
|
static WebUIControllerFactory* GetInstance();
|
|
|
|
|
|
|
|
WebUIControllerFactory();
|
2018-04-17 16:03:51 -07:00
|
|
|
~WebUIControllerFactory() override;
|
2013-05-14 14:45:34 +08:00
|
|
|
|
2018-04-17 21:46:27 -04:00
|
|
|
content::WebUI::TypeID GetWebUIType(content::BrowserContext* browser_context,
|
|
|
|
const GURL& url) const override;
|
2015-06-05 12:07:27 +08:00
|
|
|
bool UseWebUIForURL(content::BrowserContext* browser_context,
|
|
|
|
const GURL& url) const override;
|
|
|
|
bool UseWebUIBindingsForURL(content::BrowserContext* browser_context,
|
2014-10-23 11:10:39 +08:00
|
|
|
const GURL& url) const override;
|
2015-06-05 12:07:27 +08:00
|
|
|
content::WebUIController* CreateWebUIControllerForURL(
|
2013-05-14 14:45:34 +08:00
|
|
|
content::WebUI* web_ui,
|
2014-10-23 11:10:39 +08:00
|
|
|
const GURL& url) const override;
|
2013-05-14 14:45:34 +08:00
|
|
|
|
|
|
|
private:
|
2015-12-07 19:55:01 +08:00
|
|
|
friend struct base::DefaultSingletonTraits<WebUIControllerFactory>;
|
2013-05-14 14:45:34 +08:00
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(WebUIControllerFactory);
|
|
|
|
};
|
|
|
|
|
2013-11-17 18:20:17 -05:00
|
|
|
} // namespace brightray
|
2013-05-14 14:45:34 +08:00
|
|
|
|
2017-05-18 15:05:25 -07:00
|
|
|
#endif // BRIGHTRAY_BROWSER_WEB_UI_CONTROLLER_FACTORY_H_
|