Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Unified Diff: ios/web/webui/web_ui_ios_controller_factory_registry.h

Issue 1110213002: Upstream most of the iOS WebUI support in ios/web/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/web/webui/web_ui_ios_controller_factory_registry.h
diff --git a/ios/web/webui/web_ui_ios_controller_factory_registry.h b/ios/web/webui/web_ui_ios_controller_factory_registry.h
new file mode 100644
index 0000000000000000000000000000000000000000..3a49249639304e391f70e181b27df42249a4b1ac
--- /dev/null
+++ b/ios/web/webui/web_ui_ios_controller_factory_registry.h
@@ -0,0 +1,36 @@
+// Copyright 2014 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 file.
+
+#ifndef IOS_WEB_WEBUI_WEB_UI_IOS_CONTROLLER_FACTORY_REGISTRY_H_
+#define IOS_WEB_WEBUI_WEB_UI_IOS_CONTROLLER_FACTORY_REGISTRY_H_
+
+#include "base/memory/singleton.h"
+#include "ios/public/provider/web/web_ui_ios_controller_factory.h"
+
+namespace web {
+
+// A singleton which holds on to all the registered WebUIIOSControllerFactory
+// instances.
+class WebUIIOSControllerFactoryRegistry : public WebUIIOSControllerFactory {
+ public:
+ static WebUIIOSControllerFactoryRegistry* GetInstance();
+
+ // WebUIIOSControllerFactory implementation. Each method loops through the
+ // same method on all the factories.
+ WebUIIOSController* CreateWebUIIOSControllerForURL(
+ WebUIIOS* web_ui,
+ const GURL& url) const override;
+
+ private:
+ friend struct DefaultSingletonTraits<WebUIIOSControllerFactoryRegistry>;
+
+ WebUIIOSControllerFactoryRegistry();
+ ~WebUIIOSControllerFactoryRegistry() override;
+
+ DISALLOW_COPY_AND_ASSIGN(WebUIIOSControllerFactoryRegistry);
+};
+
+} // namespace web
+
+#endif // IOS_WEB_WEBUI_WEB_UI_IOS_CONTROLLER_FACTORY_REGISTRY_H_

Powered by Google App Engine
This is Rietveld 408576698