OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 5 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 #include "chrome/browser/ui/webui/predictors/predictors_ui.h" | 49 #include "chrome/browser/ui/webui/predictors/predictors_ui.h" |
50 #include "chrome/browser/ui/webui/profiler_ui.h" | 50 #include "chrome/browser/ui/webui/profiler_ui.h" |
51 #include "chrome/browser/ui/webui/signin/inline_login_ui.h" | 51 #include "chrome/browser/ui/webui/signin/inline_login_ui.h" |
52 #include "chrome/browser/ui/webui/signin/profile_signin_confirmation_ui.h" | 52 #include "chrome/browser/ui/webui/signin/profile_signin_confirmation_ui.h" |
53 #include "chrome/browser/ui/webui/signin/user_manager_ui.h" | 53 #include "chrome/browser/ui/webui/signin/user_manager_ui.h" |
54 #include "chrome/browser/ui/webui/signin_internals_ui.h" | 54 #include "chrome/browser/ui/webui/signin_internals_ui.h" |
55 #include "chrome/browser/ui/webui/sync_internals_ui.h" | 55 #include "chrome/browser/ui/webui/sync_internals_ui.h" |
56 #include "chrome/browser/ui/webui/translate_internals/translate_internals_ui.h" | 56 #include "chrome/browser/ui/webui/translate_internals/translate_internals_ui.h" |
57 #include "chrome/browser/ui/webui/user_actions/user_actions_ui.h" | 57 #include "chrome/browser/ui/webui/user_actions/user_actions_ui.h" |
58 #include "chrome/browser/ui/webui/version_ui.h" | 58 #include "chrome/browser/ui/webui/version_ui.h" |
59 #include "chrome/browser/ui/webui/voicesearch_ui.h" | |
60 #include "chrome/common/chrome_switches.h" | 59 #include "chrome/common/chrome_switches.h" |
61 #include "chrome/common/extensions/extension_constants.h" | 60 #include "chrome/common/extensions/extension_constants.h" |
62 #include "chrome/common/pref_names.h" | 61 #include "chrome/common/pref_names.h" |
63 #include "chrome/common/url_constants.h" | 62 #include "chrome/common/url_constants.h" |
64 #include "components/dom_distiller/core/dom_distiller_constants.h" | 63 #include "components/dom_distiller/core/dom_distiller_constants.h" |
65 #include "components/dom_distiller/core/dom_distiller_service.h" | 64 #include "components/dom_distiller/core/dom_distiller_service.h" |
66 #include "components/dom_distiller/webui/dom_distiller_ui.h" | 65 #include "components/dom_distiller/webui/dom_distiller_ui.h" |
67 #include "components/favicon_base/favicon_util.h" | 66 #include "components/favicon_base/favicon_util.h" |
68 #include "components/favicon_base/select_favicon_frames.h" | 67 #include "components/favicon_base/select_favicon_frames.h" |
69 #include "components/password_manager/core/common/password_manager_switches.h" | 68 #include "components/password_manager/core/common/password_manager_switches.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 #endif | 154 #endif |
156 | 155 |
157 #if defined(ENABLE_SERVICE_DISCOVERY) | 156 #if defined(ENABLE_SERVICE_DISCOVERY) |
158 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui.h" | 157 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui.h" |
159 #endif | 158 #endif |
160 | 159 |
161 #if defined(ENABLE_APP_LIST) | 160 #if defined(ENABLE_APP_LIST) |
162 #include "chrome/browser/ui/webui/app_list/start_page_ui.h" | 161 #include "chrome/browser/ui/webui/app_list/start_page_ui.h" |
163 #endif | 162 #endif |
164 | 163 |
| 164 #if defined(ENABLE_EXTENSIONS) |
| 165 #include "chrome/browser/ui/webui/voicesearch_ui.h" |
| 166 #endif |
| 167 |
165 using content::WebUI; | 168 using content::WebUI; |
166 using content::WebUIController; | 169 using content::WebUIController; |
167 using ui::ExternalWebDialogUI; | 170 using ui::ExternalWebDialogUI; |
168 using ui::WebDialogUI; | 171 using ui::WebDialogUI; |
169 | 172 |
170 namespace { | 173 namespace { |
171 | 174 |
172 // A function for creating a new WebUI. The caller owns the return value, which | 175 // A function for creating a new WebUI. The caller owns the return value, which |
173 // may be NULL (for example, if the URL refers to an non-existent extension). | 176 // may be NULL (for example, if the URL refers to an non-existent extension). |
174 typedef WebUIController* (*WebUIFactoryFunction)(WebUI* web_ui, | 177 typedef WebUIController* (*WebUIFactoryFunction)(WebUI* web_ui, |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 if (url.host() == chrome::kChromeUISyncInternalsHost) | 321 if (url.host() == chrome::kChromeUISyncInternalsHost) |
319 return &NewWebUI<SyncInternalsUI>; | 322 return &NewWebUI<SyncInternalsUI>; |
320 if (url.host() == chrome::kChromeUISyncResourcesHost) | 323 if (url.host() == chrome::kChromeUISyncResourcesHost) |
321 return &NewWebUI<WebDialogUI>; | 324 return &NewWebUI<WebDialogUI>; |
322 if (url.host() == chrome::kChromeUITranslateInternalsHost) | 325 if (url.host() == chrome::kChromeUITranslateInternalsHost) |
323 return &NewWebUI<TranslateInternalsUI>; | 326 return &NewWebUI<TranslateInternalsUI>; |
324 if (url.host() == chrome::kChromeUIUserActionsHost) | 327 if (url.host() == chrome::kChromeUIUserActionsHost) |
325 return &NewWebUI<UserActionsUI>; | 328 return &NewWebUI<UserActionsUI>; |
326 if (url.host() == chrome::kChromeUIVersionHost) | 329 if (url.host() == chrome::kChromeUIVersionHost) |
327 return &NewWebUI<VersionUI>; | 330 return &NewWebUI<VersionUI>; |
| 331 #if defined(ENABLE_EXTENSIONS) |
328 if (url.host() == chrome::kChromeUIVoiceSearchHost) | 332 if (url.host() == chrome::kChromeUIVoiceSearchHost) |
329 return &NewWebUI<VoiceSearchUI>; | 333 return &NewWebUI<VoiceSearchUI>; |
| 334 #endif |
330 #if defined(ENABLE_WEBRTC) | 335 #if defined(ENABLE_WEBRTC) |
331 if (url.host() == chrome::kChromeUIWebRtcLogsHost) | 336 if (url.host() == chrome::kChromeUIWebRtcLogsHost) |
332 return &NewWebUI<WebRtcLogsUI>; | 337 return &NewWebUI<WebRtcLogsUI>; |
333 #endif | 338 #endif |
334 #if defined(ENABLE_APP_LIST) | 339 #if defined(ENABLE_APP_LIST) |
335 if (url.host() == chrome::kChromeUIAppListStartPageHost) | 340 if (url.host() == chrome::kChromeUIAppListStartPageHost) |
336 return &NewWebUI<app_list::StartPageUI>; | 341 return &NewWebUI<app_list::StartPageUI>; |
337 #endif | 342 #endif |
338 | 343 |
339 /**************************************************************************** | 344 /**************************************************************************** |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 #endif | 718 #endif |
714 | 719 |
715 // Android doesn't use the plugins pages. | 720 // Android doesn't use the plugins pages. |
716 if (page_url.host() == chrome::kChromeUIPluginsHost) | 721 if (page_url.host() == chrome::kChromeUIPluginsHost) |
717 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 722 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
718 | 723 |
719 #endif | 724 #endif |
720 | 725 |
721 return NULL; | 726 return NULL; |
722 } | 727 } |
OLD | NEW |