| 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" | 38 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
| 39 #include "chrome/browser/ui/webui/omnibox/omnibox_ui.h" | 39 #include "chrome/browser/ui/webui/omnibox/omnibox_ui.h" |
| 40 #include "chrome/browser/ui/webui/options/options_ui.h" | 40 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 41 #include "chrome/browser/ui/webui/performance_monitor/performance_monitor_ui.h" | 41 #include "chrome/browser/ui/webui/performance_monitor/performance_monitor_ui.h" |
| 42 #include "chrome/browser/ui/webui/plugins_ui.h" | 42 #include "chrome/browser/ui/webui/plugins_ui.h" |
| 43 #include "chrome/browser/ui/webui/predictors/predictors_ui.h" | 43 #include "chrome/browser/ui/webui/predictors/predictors_ui.h" |
| 44 #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" | 44 #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h" |
| 45 #include "chrome/browser/ui/webui/profiler_ui.h" | 45 #include "chrome/browser/ui/webui/profiler_ui.h" |
| 46 #include "chrome/browser/ui/webui/quota_internals/quota_internals_ui.h" | 46 #include "chrome/browser/ui/webui/quota_internals/quota_internals_ui.h" |
| 47 #include "chrome/browser/ui/webui/signin/profile_signin_confirmation_ui.h" | 47 #include "chrome/browser/ui/webui/signin/profile_signin_confirmation_ui.h" |
| 48 #include "chrome/browser/ui/webui/signin/user_chooser_ui.h" |
| 48 #include "chrome/browser/ui/webui/signin_internals_ui.h" | 49 #include "chrome/browser/ui/webui/signin_internals_ui.h" |
| 49 #include "chrome/browser/ui/webui/sync_internals_ui.h" | 50 #include "chrome/browser/ui/webui/sync_internals_ui.h" |
| 50 #include "chrome/browser/ui/webui/translate_internals/translate_internals_ui.h" | 51 #include "chrome/browser/ui/webui/translate_internals/translate_internals_ui.h" |
| 51 #include "chrome/browser/ui/webui/user_actions/user_actions_ui.h" | 52 #include "chrome/browser/ui/webui/user_actions/user_actions_ui.h" |
| 52 #include "chrome/browser/ui/webui/version_ui.h" | 53 #include "chrome/browser/ui/webui/version_ui.h" |
| 53 #include "chrome/common/chrome_switches.h" | 54 #include "chrome/common/chrome_switches.h" |
| 54 #include "chrome/common/extensions/extension_constants.h" | 55 #include "chrome/common/extensions/extension_constants.h" |
| 55 #include "chrome/common/extensions/feature_switch.h" | 56 #include "chrome/common/extensions/feature_switch.h" |
| 56 #include "chrome/common/pref_names.h" | 57 #include "chrome/common/pref_names.h" |
| 57 #include "chrome/common/url_constants.h" | 58 #include "chrome/common/url_constants.h" |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 } | 368 } |
| 368 #endif | 369 #endif |
| 369 | 370 |
| 370 #if defined(USE_AURA) | 371 #if defined(USE_AURA) |
| 371 if (url.host() == chrome::kChromeUIGestureConfigHost) | 372 if (url.host() == chrome::kChromeUIGestureConfigHost) |
| 372 return &NewWebUI<GestureConfigUI>; | 373 return &NewWebUI<GestureConfigUI>; |
| 373 if (url.host() == keyboard::kKeyboardWebUIHost) | 374 if (url.host() == keyboard::kKeyboardWebUIHost) |
| 374 return &NewWebUI<keyboard::KeyboardUIController>; | 375 return &NewWebUI<keyboard::KeyboardUIController>; |
| 375 #endif | 376 #endif |
| 376 | 377 |
| 378 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS) |
| 379 if (url.host() == chrome::kChromeUIUserChooserHost && |
| 380 CommandLine::ForCurrentProcess()->HasSwitch( |
| 381 switches::kNewProfileManagement)) |
| 382 return &NewWebUI<UserChooserUI>; |
| 383 #endif |
| 384 |
| 377 if (url.host() == chrome::kChromeUIChromeURLsHost || | 385 if (url.host() == chrome::kChromeUIChromeURLsHost || |
| 378 url.host() == chrome::kChromeUICreditsHost || | 386 url.host() == chrome::kChromeUICreditsHost || |
| 379 url.host() == chrome::kChromeUIDNSHost || | 387 url.host() == chrome::kChromeUIDNSHost || |
| 380 url.host() == chrome::kChromeUIMemoryHost || | 388 url.host() == chrome::kChromeUIMemoryHost || |
| 381 url.host() == chrome::kChromeUIMemoryRedirectHost || | 389 url.host() == chrome::kChromeUIMemoryRedirectHost || |
| 382 url.host() == chrome::kChromeUIStatsHost || | 390 url.host() == chrome::kChromeUIStatsHost || |
| 383 url.host() == chrome::kChromeUITermsHost | 391 url.host() == chrome::kChromeUITermsHost |
| 384 #if defined(OS_LINUX) || defined(OS_OPENBSD) | 392 #if defined(OS_LINUX) || defined(OS_OPENBSD) |
| 385 || url.host() == chrome::kChromeUILinuxProxyConfigHost | 393 || url.host() == chrome::kChromeUILinuxProxyConfigHost |
| 386 || url.host() == chrome::kChromeUISandboxHost | 394 || url.host() == chrome::kChromeUISandboxHost |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 if (page_url.host() == chrome::kChromeUISettingsFrameHost) | 575 if (page_url.host() == chrome::kChromeUISettingsFrameHost) |
| 568 return options::OptionsUI::GetFaviconResourceBytes(scale_factor); | 576 return options::OptionsUI::GetFaviconResourceBytes(scale_factor); |
| 569 | 577 |
| 570 // Android doesn't use the plugins pages. | 578 // Android doesn't use the plugins pages. |
| 571 if (page_url.host() == chrome::kChromeUIPluginsHost) | 579 if (page_url.host() == chrome::kChromeUIPluginsHost) |
| 572 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 580 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
| 573 #endif | 581 #endif |
| 574 | 582 |
| 575 return NULL; | 583 return NULL; |
| 576 } | 584 } |
| OLD | NEW |