| 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/gfx/favicon_size.h" | 64 #include "ui/gfx/favicon_size.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 if (url.host() == chrome::kChromeUIPredictorsHost) | 216 if (url.host() == chrome::kChromeUIPredictorsHost) |
| 216 return &NewWebUI<PredictorsUI>; | 217 return &NewWebUI<PredictorsUI>; |
| 217 if (url.host() == chrome::kChromeUIProfilerHost) | 218 if (url.host() == chrome::kChromeUIProfilerHost) |
| 218 return &NewWebUI<ProfilerUI>; | 219 return &NewWebUI<ProfilerUI>; |
| 219 if (url.host() == chrome::kChromeUIQuotaInternalsHost) | 220 if (url.host() == chrome::kChromeUIQuotaInternalsHost) |
| 220 return &NewWebUI<QuotaInternalsUI>; | 221 return &NewWebUI<QuotaInternalsUI>; |
| 221 if (url.host() == chrome::kChromeUISyncInternalsHost) | 222 if (url.host() == chrome::kChromeUISyncInternalsHost) |
| 222 return &NewWebUI<SyncInternalsUI>; | 223 return &NewWebUI<SyncInternalsUI>; |
| 223 if (url.host() == chrome::kChromeUISyncResourcesHost) | 224 if (url.host() == chrome::kChromeUISyncResourcesHost) |
| 224 return &NewWebUI<WebDialogUI>; | 225 return &NewWebUI<WebDialogUI>; |
| 226 if (url.host() == chrome::kChromeUIVersionHost) |
| 227 return &NewWebUI<VersionUI>; |
| 225 | 228 |
| 226 /**************************************************************************** | 229 /**************************************************************************** |
| 227 * OS Specific #defines | 230 * OS Specific #defines |
| 228 ***************************************************************************/ | 231 ***************************************************************************/ |
| 229 #if defined(OS_ANDROID) | 232 #if defined(OS_ANDROID) |
| 230 if (url.host() == chrome::kChromeUIWelcomeHost) | 233 if (url.host() == chrome::kChromeUIWelcomeHost) |
| 231 return &NewWebUI<WelcomeUI>; | 234 return &NewWebUI<WelcomeUI>; |
| 232 #else | 235 #else |
| 233 // Bookmarks are part of NTP on Android. | 236 // Bookmarks are part of NTP on Android. |
| 234 if (url.host() == chrome::kChromeUIBookmarksHost) | 237 if (url.host() == chrome::kChromeUIBookmarksHost) |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 return &NewWebUI<NewTabUI>; | 358 return &NewWebUI<NewTabUI>; |
| 356 } | 359 } |
| 357 #endif | 360 #endif |
| 358 | 361 |
| 359 if (url.host() == chrome::kChromeUIChromeURLsHost || | 362 if (url.host() == chrome::kChromeUIChromeURLsHost || |
| 360 url.host() == chrome::kChromeUICreditsHost || | 363 url.host() == chrome::kChromeUICreditsHost || |
| 361 url.host() == chrome::kChromeUIDNSHost || | 364 url.host() == chrome::kChromeUIDNSHost || |
| 362 url.host() == chrome::kChromeUIMemoryHost || | 365 url.host() == chrome::kChromeUIMemoryHost || |
| 363 url.host() == chrome::kChromeUIMemoryRedirectHost || | 366 url.host() == chrome::kChromeUIMemoryRedirectHost || |
| 364 url.host() == chrome::kChromeUIStatsHost || | 367 url.host() == chrome::kChromeUIStatsHost || |
| 365 url.host() == chrome::kChromeUITermsHost || | 368 url.host() == chrome::kChromeUITermsHost |
| 366 url.host() == chrome::kChromeUIVersionHost | |
| 367 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 369 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
| 368 || url.host() == chrome::kChromeUILinuxProxyConfigHost | 370 || url.host() == chrome::kChromeUILinuxProxyConfigHost |
| 369 || url.host() == chrome::kChromeUISandboxHost | 371 || url.host() == chrome::kChromeUISandboxHost |
| 370 #endif | 372 #endif |
| 371 #if defined(OS_CHROMEOS) | 373 #if defined(OS_CHROMEOS) |
| 372 || url.host() == chrome::kChromeUIDiscardsHost | 374 || url.host() == chrome::kChromeUIDiscardsHost |
| 373 || url.host() == chrome::kChromeUINetworkHost | 375 || url.host() == chrome::kChromeUINetworkHost |
| 374 || url.host() == chrome::kChromeUIOSCreditsHost | 376 || url.host() == chrome::kChromeUIOSCreditsHost |
| 375 || url.host() == chrome::kChromeUITransparencyHost | 377 || url.host() == chrome::kChromeUITransparencyHost |
| 376 #endif | 378 #endif |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 if (page_url.host() == chrome::kChromeUISettingsFrameHost) | 593 if (page_url.host() == chrome::kChromeUISettingsFrameHost) |
| 592 return options::OptionsUI::GetFaviconResourceBytes(scale_factor); | 594 return options::OptionsUI::GetFaviconResourceBytes(scale_factor); |
| 593 | 595 |
| 594 // Android doesn't use the plugins pages. | 596 // Android doesn't use the plugins pages. |
| 595 if (page_url.host() == chrome::kChromeUIPluginsHost) | 597 if (page_url.host() == chrome::kChromeUIPluginsHost) |
| 596 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 598 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
| 597 #endif | 599 #endif |
| 598 | 600 |
| 599 return NULL; | 601 return NULL; |
| 600 } | 602 } |
| OLD | NEW |