| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/about_flags.h" | 8 #include "chrome/browser/about_flags.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/extensions/extension_web_ui.h" | 10 #include "chrome/browser/extensions/extension_web_ui.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "chrome/browser/ui/webui/policy_ui.h" | 44 #include "chrome/browser/ui/webui/policy_ui.h" |
| 45 #include "chrome/browser/ui/webui/predictors/predictors_ui.h" | 45 #include "chrome/browser/ui/webui/predictors/predictors_ui.h" |
| 46 #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" | 46 #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" |
| 47 #include "chrome/browser/ui/webui/profiler_ui.h" | 47 #include "chrome/browser/ui/webui/profiler_ui.h" |
| 48 #include "chrome/browser/ui/webui/quota_internals_ui.h" | 48 #include "chrome/browser/ui/webui/quota_internals_ui.h" |
| 49 #include "chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui
.h" | 49 #include "chrome/browser/ui/webui/suggestions_internals/suggestions_internals_ui
.h" |
| 50 #include "chrome/browser/ui/webui/sync_internals_ui.h" | 50 #include "chrome/browser/ui/webui/sync_internals_ui.h" |
| 51 #include "chrome/browser/ui/webui/task_manager/task_manager_ui.h" | 51 #include "chrome/browser/ui/webui/task_manager/task_manager_ui.h" |
| 52 #include "chrome/browser/ui/webui/test_chrome_web_ui_controller_factory.h" | 52 #include "chrome/browser/ui/webui/test_chrome_web_ui_controller_factory.h" |
| 53 #include "chrome/browser/ui/webui/tracing_ui.h" | 53 #include "chrome/browser/ui/webui/tracing_ui.h" |
| 54 #include "chrome/browser/ui/webui/version_ui.h" |
| 54 #include "chrome/common/chrome_switches.h" | 55 #include "chrome/common/chrome_switches.h" |
| 55 #include "chrome/common/extensions/extension_constants.h" | 56 #include "chrome/common/extensions/extension_constants.h" |
| 56 #include "chrome/common/extensions/extension_switch_utils.h" | 57 #include "chrome/common/extensions/extension_switch_utils.h" |
| 57 #include "chrome/common/pref_names.h" | 58 #include "chrome/common/pref_names.h" |
| 58 #include "chrome/common/url_constants.h" | 59 #include "chrome/common/url_constants.h" |
| 59 #include "content/public/browser/web_contents.h" | 60 #include "content/public/browser/web_contents.h" |
| 60 #include "content/public/browser/web_ui.h" | 61 #include "content/public/browser/web_ui.h" |
| 61 #include "content/public/common/content_client.h" | 62 #include "content/public/common/content_client.h" |
| 62 #include "googleurl/src/gurl.h" | 63 #include "googleurl/src/gurl.h" |
| 63 #include "ui/web_dialogs/constrained_web_dialog_ui.h" | 64 #include "ui/web_dialogs/constrained_web_dialog_ui.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 if (url.host() == chrome::kChromeUIProfilerHost) | 225 if (url.host() == chrome::kChromeUIProfilerHost) |
| 225 return &NewWebUI<ProfilerUI>; | 226 return &NewWebUI<ProfilerUI>; |
| 226 if (url.host() == chrome::kChromeUIQuotaInternalsHost) | 227 if (url.host() == chrome::kChromeUIQuotaInternalsHost) |
| 227 return &NewWebUI<QuotaInternalsUI>; | 228 return &NewWebUI<QuotaInternalsUI>; |
| 228 if (url.host() == chrome::kChromeUISyncInternalsHost) | 229 if (url.host() == chrome::kChromeUISyncInternalsHost) |
| 229 return &NewWebUI<SyncInternalsUI>; | 230 return &NewWebUI<SyncInternalsUI>; |
| 230 if (url.host() == chrome::kChromeUISyncResourcesHost) | 231 if (url.host() == chrome::kChromeUISyncResourcesHost) |
| 231 return &NewWebUI<WebDialogUI>; | 232 return &NewWebUI<WebDialogUI>; |
| 232 if (url.host() == chrome::kChromeUITracingHost) | 233 if (url.host() == chrome::kChromeUITracingHost) |
| 233 return &NewWebUI<TracingUI>; | 234 return &NewWebUI<TracingUI>; |
| 235 if (url.host() == chrome::kChromeUIVersionHost) |
| 236 return &NewWebUI<VersionUI>; |
| 234 | 237 |
| 235 /**************************************************************************** | 238 /**************************************************************************** |
| 236 * OS Specific #defines | 239 * OS Specific #defines |
| 237 ***************************************************************************/ | 240 ***************************************************************************/ |
| 238 #if defined(OS_ANDROID) | 241 #if defined(OS_ANDROID) |
| 239 if (url.host() == chrome::kChromeUIWelcomeHost) | 242 if (url.host() == chrome::kChromeUIWelcomeHost) |
| 240 return &NewWebUI<WelcomeUI>; | 243 return &NewWebUI<WelcomeUI>; |
| 241 #else | 244 #else |
| 242 // These pages are implemented with native UI elements on Android. | 245 // These pages are implemented with native UI elements on Android. |
| 243 if (url.host() == chrome::kChromeUIDownloadsHost) | 246 if (url.host() == chrome::kChromeUIDownloadsHost) |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 return &NewWebUI<NewTabUI>; | 355 return &NewWebUI<NewTabUI>; |
| 353 } | 356 } |
| 354 #endif | 357 #endif |
| 355 | 358 |
| 356 if (url.host() == chrome::kChromeUIChromeURLsHost || | 359 if (url.host() == chrome::kChromeUIChromeURLsHost || |
| 357 url.host() == chrome::kChromeUICreditsHost || | 360 url.host() == chrome::kChromeUICreditsHost || |
| 358 url.host() == chrome::kChromeUIDNSHost || | 361 url.host() == chrome::kChromeUIDNSHost || |
| 359 url.host() == chrome::kChromeUIMemoryHost || | 362 url.host() == chrome::kChromeUIMemoryHost || |
| 360 url.host() == chrome::kChromeUIMemoryRedirectHost || | 363 url.host() == chrome::kChromeUIMemoryRedirectHost || |
| 361 url.host() == chrome::kChromeUIStatsHost || | 364 url.host() == chrome::kChromeUIStatsHost || |
| 362 url.host() == chrome::kChromeUITermsHost || | 365 url.host() == chrome::kChromeUITermsHost |
| 363 url.host() == chrome::kChromeUIVersionHost | |
| 364 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 366 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
| 365 || url.host() == chrome::kChromeUILinuxProxyConfigHost | 367 || url.host() == chrome::kChromeUILinuxProxyConfigHost |
| 366 || url.host() == chrome::kChromeUISandboxHost | 368 || url.host() == chrome::kChromeUISandboxHost |
| 367 #endif | 369 #endif |
| 368 #if defined(OS_CHROMEOS) | 370 #if defined(OS_CHROMEOS) |
| 369 || url.host() == chrome::kChromeUIDiscardsHost | 371 || url.host() == chrome::kChromeUIDiscardsHost |
| 370 || url.host() == chrome::kChromeUINetworkHost | 372 || url.host() == chrome::kChromeUINetworkHost |
| 371 || url.host() == chrome::kChromeUIOSCreditsHost | 373 || url.host() == chrome::kChromeUIOSCreditsHost |
| 372 || url.host() == chrome::kChromeUITransparencyHost | 374 || url.host() == chrome::kChromeUITransparencyHost |
| 373 #endif | 375 #endif |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 if (page_url.host() == chrome::kChromeUISettingsFrameHost) | 554 if (page_url.host() == chrome::kChromeUISettingsFrameHost) |
| 553 return options::OptionsUI::GetFaviconResourceBytes(scale_factor); | 555 return options::OptionsUI::GetFaviconResourceBytes(scale_factor); |
| 554 | 556 |
| 555 // Android doesn't use the plugins pages. | 557 // Android doesn't use the plugins pages. |
| 556 if (page_url.host() == chrome::kChromeUIPluginsHost) | 558 if (page_url.host() == chrome::kChromeUIPluginsHost) |
| 557 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 559 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
| 558 #endif | 560 #endif |
| 559 | 561 |
| 560 return NULL; | 562 return NULL; |
| 561 } | 563 } |
| OLD | NEW |