OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ios/chrome/browser/ui/webui/chrome_web_ui_ios_controller_factory.h" | 5 #include "ios/chrome/browser/ui/webui/chrome_web_ui_ios_controller_factory.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "ios/chrome/browser/chrome_url_constants.h" | 10 #include "ios/chrome/browser/chrome_url_constants.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 if (url_host == kChromeUISignInInternalsHost) | 82 if (url_host == kChromeUISignInInternalsHost) |
83 return &NewWebUIIOS<SignInInternalsUIIOS>; | 83 return &NewWebUIIOS<SignInInternalsUIIOS>; |
84 if (url_host == kChromeUISyncInternalsHost) | 84 if (url_host == kChromeUISyncInternalsHost) |
85 return &NewWebUIIOS<SyncInternalsUI>; | 85 return &NewWebUIIOS<SyncInternalsUI>; |
86 if (url_host == kChromeUITermsHost) | 86 if (url_host == kChromeUITermsHost) |
87 return &NewWebUIIOSWithHost<TermsUI>; | 87 return &NewWebUIIOSWithHost<TermsUI>; |
88 if (url_host == kChromeUIVersionHost) | 88 if (url_host == kChromeUIVersionHost) |
89 return &NewWebUIIOS<VersionUI>; | 89 return &NewWebUIIOS<VersionUI>; |
90 if (url_host == kChromeUIFlagsHost) | 90 if (url_host == kChromeUIFlagsHost) |
91 return &NewWebUIIOS<FlagsUI>; | 91 return &NewWebUIIOS<FlagsUI>; |
92 if (url_host == kChromeUIAppleFlagsHost) | |
93 return &NewWebUIIOS<AppleFlagsUI>; | |
94 | 92 |
95 return nullptr; | 93 return nullptr; |
96 } | 94 } |
97 | 95 |
98 } // namespace | 96 } // namespace |
99 | 97 |
100 std::unique_ptr<WebUIIOSController> | 98 std::unique_ptr<WebUIIOSController> |
101 ChromeWebUIIOSControllerFactory::CreateWebUIIOSControllerForURL( | 99 ChromeWebUIIOSControllerFactory::CreateWebUIIOSControllerForURL( |
102 WebUIIOS* web_ui, | 100 WebUIIOS* web_ui, |
103 const GURL& url) const { | 101 const GURL& url) const { |
104 WebUIIOSFactoryFunction function = GetWebUIIOSFactoryFunction(web_ui, url); | 102 WebUIIOSFactoryFunction function = GetWebUIIOSFactoryFunction(web_ui, url); |
105 if (!function) | 103 if (!function) |
106 return nullptr; | 104 return nullptr; |
107 | 105 |
108 return (*function)(web_ui, url); | 106 return (*function)(web_ui, url); |
109 } | 107 } |
110 | 108 |
111 // static | 109 // static |
112 ChromeWebUIIOSControllerFactory* | 110 ChromeWebUIIOSControllerFactory* |
113 ChromeWebUIIOSControllerFactory::GetInstance() { | 111 ChromeWebUIIOSControllerFactory::GetInstance() { |
114 return base::Singleton<ChromeWebUIIOSControllerFactory>::get(); | 112 return base::Singleton<ChromeWebUIIOSControllerFactory>::get(); |
115 } | 113 } |
116 | 114 |
117 ChromeWebUIIOSControllerFactory::ChromeWebUIIOSControllerFactory() {} | 115 ChromeWebUIIOSControllerFactory::ChromeWebUIIOSControllerFactory() {} |
118 | 116 |
119 ChromeWebUIIOSControllerFactory::~ChromeWebUIIOSControllerFactory() {} | 117 ChromeWebUIIOSControllerFactory::~ChromeWebUIIOSControllerFactory() {} |
OLD | NEW |