Chromium Code Reviews| 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 (url.host() == chrome::kChromeUIVersionHost) | |
|
Evan Stade
2012/09/14 09:18:02
this belongs in the main block (L235)
SteveT
2012/09/14 14:48:15
Done.
| |
| 358 return &NewWebUI<VersionUI>; | |
| 359 | |
| 356 if (url.host() == chrome::kChromeUIChromeURLsHost || | 360 if (url.host() == chrome::kChromeUIChromeURLsHost || |
| 357 url.host() == chrome::kChromeUICreditsHost || | 361 url.host() == chrome::kChromeUICreditsHost || |
| 358 url.host() == chrome::kChromeUIDNSHost || | 362 url.host() == chrome::kChromeUIDNSHost || |
| 359 url.host() == chrome::kChromeUIMemoryHost || | 363 url.host() == chrome::kChromeUIMemoryHost || |
| 360 url.host() == chrome::kChromeUIMemoryRedirectHost || | 364 url.host() == chrome::kChromeUIMemoryRedirectHost || |
| 361 url.host() == chrome::kChromeUIStatsHost || | 365 url.host() == chrome::kChromeUIStatsHost || |
| 362 url.host() == chrome::kChromeUITermsHost || | 366 url.host() == chrome::kChromeUITermsHost |
| 363 url.host() == chrome::kChromeUIVersionHost | |
| 364 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 367 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
| 365 || url.host() == chrome::kChromeUILinuxProxyConfigHost | 368 || url.host() == chrome::kChromeUILinuxProxyConfigHost |
| 366 || url.host() == chrome::kChromeUISandboxHost | 369 || url.host() == chrome::kChromeUISandboxHost |
| 367 #endif | 370 #endif |
| 368 #if defined(OS_CHROMEOS) | 371 #if defined(OS_CHROMEOS) |
| 369 || url.host() == chrome::kChromeUIDiscardsHost | 372 || url.host() == chrome::kChromeUIDiscardsHost |
| 370 || url.host() == chrome::kChromeUINetworkHost | 373 || url.host() == chrome::kChromeUINetworkHost |
| 371 || url.host() == chrome::kChromeUIOSCreditsHost | 374 || url.host() == chrome::kChromeUIOSCreditsHost |
| 372 || url.host() == chrome::kChromeUITransparencyHost | 375 || url.host() == chrome::kChromeUITransparencyHost |
| 373 #endif | 376 #endif |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 552 if (page_url.host() == chrome::kChromeUISettingsFrameHost) | 555 if (page_url.host() == chrome::kChromeUISettingsFrameHost) |
| 553 return options::OptionsUI::GetFaviconResourceBytes(scale_factor); | 556 return options::OptionsUI::GetFaviconResourceBytes(scale_factor); |
| 554 | 557 |
| 555 // Android doesn't use the plugins pages. | 558 // Android doesn't use the plugins pages. |
| 556 if (page_url.host() == chrome::kChromeUIPluginsHost) | 559 if (page_url.host() == chrome::kChromeUIPluginsHost) |
| 557 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 560 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
| 558 #endif | 561 #endif |
| 559 | 562 |
| 560 return NULL; | 563 return NULL; |
| 561 } | 564 } |
| OLD | NEW |