| 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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 // use the NTP WebUI. We don't want to return NULL if the sync promo page | 347 // use the NTP WebUI. We don't want to return NULL if the sync promo page |
| 347 // is disabled because the page can be disabled mid-flight (for example, | 348 // is disabled because the page can be disabled mid-flight (for example, |
| 348 // if sync login finishes). | 349 // if sync login finishes). |
| 349 if (SyncPromoUI::ShouldShowSyncPromo(profile)) | 350 if (SyncPromoUI::ShouldShowSyncPromo(profile)) |
| 350 return &NewWebUI<SyncPromoUI>; | 351 return &NewWebUI<SyncPromoUI>; |
| 351 else | 352 else |
| 352 return &NewWebUI<NewTabUI>; | 353 return &NewWebUI<NewTabUI>; |
| 353 } | 354 } |
| 354 #endif | 355 #endif |
| 355 | 356 |
| 357 #if !defined(OS_CHROMEOS) |
| 358 // TODO(stevet): OS_CHROMEOS still uses AboutUI, below. It needs to be |
| 359 // refactored out. |
| 360 if (url.host() == chrome::kChromeUIVersionHost) |
| 361 return &NewWebUI<VersionUI>; |
| 362 #endif |
| 363 |
| 356 if (url.host() == chrome::kChromeUIChromeURLsHost || | 364 if (url.host() == chrome::kChromeUIChromeURLsHost || |
| 357 url.host() == chrome::kChromeUICreditsHost || | 365 url.host() == chrome::kChromeUICreditsHost || |
| 358 url.host() == chrome::kChromeUIDNSHost || | 366 url.host() == chrome::kChromeUIDNSHost || |
| 359 url.host() == chrome::kChromeUIMemoryHost || | 367 url.host() == chrome::kChromeUIMemoryHost || |
| 360 url.host() == chrome::kChromeUIMemoryRedirectHost || | 368 url.host() == chrome::kChromeUIMemoryRedirectHost || |
| 361 url.host() == chrome::kChromeUIStatsHost || | 369 url.host() == chrome::kChromeUIStatsHost || |
| 362 url.host() == chrome::kChromeUITermsHost || | 370 url.host() == chrome::kChromeUITermsHost |
| 363 url.host() == chrome::kChromeUIVersionHost | |
| 364 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 371 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
| 365 || url.host() == chrome::kChromeUILinuxProxyConfigHost | 372 || url.host() == chrome::kChromeUILinuxProxyConfigHost |
| 366 || url.host() == chrome::kChromeUISandboxHost | 373 || url.host() == chrome::kChromeUISandboxHost |
| 367 #endif | 374 #endif |
| 368 #if defined(OS_CHROMEOS) | 375 #if defined(OS_CHROMEOS) |
| 369 || url.host() == chrome::kChromeUIDiscardsHost | 376 || url.host() == chrome::kChromeUIDiscardsHost |
| 370 || url.host() == chrome::kChromeUINetworkHost | 377 || url.host() == chrome::kChromeUINetworkHost |
| 371 || url.host() == chrome::kChromeUIOSCreditsHost | 378 || url.host() == chrome::kChromeUIOSCreditsHost |
| 372 || url.host() == chrome::kChromeUITransparencyHost | 379 || url.host() == chrome::kChromeUITransparencyHost |
| 380 || url.host() == chrome::kChromeUIVersionHost |
| 373 #endif | 381 #endif |
| 374 #if defined(WEBUI_TASK_MANAGER) | 382 #if defined(WEBUI_TASK_MANAGER) |
| 375 || url.host() == chrome::kChromeUITaskManagerHost | 383 || url.host() == chrome::kChromeUITaskManagerHost |
| 376 #endif | 384 #endif |
| 377 ) { | 385 ) { |
| 378 return &NewWebUI<AboutUI>; | 386 return &NewWebUI<AboutUI>; |
| 379 } | 387 } |
| 380 | 388 |
| 381 if (url.host() == chrome::kChromeUIExtensionActivityHost && | 389 if (url.host() == chrome::kChromeUIExtensionActivityHost && |
| 382 CommandLine::ForCurrentProcess()->HasSwitch( | 390 CommandLine::ForCurrentProcess()->HasSwitch( |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 if (page_url.host() == chrome::kChromeUISettingsFrameHost) | 556 if (page_url.host() == chrome::kChromeUISettingsFrameHost) |
| 549 return options::OptionsUI::GetFaviconResourceBytes(); | 557 return options::OptionsUI::GetFaviconResourceBytes(); |
| 550 | 558 |
| 551 // Android doesn't use the plugins pages. | 559 // Android doesn't use the plugins pages. |
| 552 if (page_url.host() == chrome::kChromeUIPluginsHost) | 560 if (page_url.host() == chrome::kChromeUIPluginsHost) |
| 553 return PluginsUI::GetFaviconResourceBytes(); | 561 return PluginsUI::GetFaviconResourceBytes(); |
| 554 #endif | 562 #endif |
| 555 | 563 |
| 556 return NULL; | 564 return NULL; |
| 557 } | 565 } |
| OLD | NEW |