| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_factory.h" | 5 #include "chrome/browser/ui/webui/chrome_web_ui_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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.h" | 50 #include "chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.h" |
| 51 #include "chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.h" | 51 #include "chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.h" |
| 52 #include "chrome/browser/ui/webui/chromeos/login/login_ui.h" | 52 #include "chrome/browser/ui/webui/chromeos/login/login_ui.h" |
| 53 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 53 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 54 #include "chrome/browser/ui/webui/chromeos/mobile_setup_ui.h" | 54 #include "chrome/browser/ui/webui/chromeos/mobile_setup_ui.h" |
| 55 #include "chrome/browser/ui/webui/chromeos/proxy_settings_ui.h" | 55 #include "chrome/browser/ui/webui/chromeos/proxy_settings_ui.h" |
| 56 #include "chrome/browser/ui/webui/chromeos/register_page_ui.h" | 56 #include "chrome/browser/ui/webui/chromeos/register_page_ui.h" |
| 57 #include "chrome/browser/ui/webui/chromeos/sim_unlock_ui.h" | 57 #include "chrome/browser/ui/webui/chromeos/sim_unlock_ui.h" |
| 58 #include "chrome/browser/ui/webui/chromeos/system_info_ui.h" | 58 #include "chrome/browser/ui/webui/chromeos/system_info_ui.h" |
| 59 #include "chrome/browser/ui/webui/active_downloads_ui.h" | 59 #include "chrome/browser/ui/webui/active_downloads_ui.h" |
| 60 #else | |
| 61 #include "chrome/browser/ui/webui/new_profile_ui.h" | |
| 62 #endif | 60 #endif |
| 63 | 61 |
| 64 #if defined(TOUCH_UI) | 62 #if defined(TOUCH_UI) |
| 65 #include "chrome/browser/ui/webui/keyboard_ui.h" | 63 #include "chrome/browser/ui/webui/keyboard_ui.h" |
| 66 #endif | 64 #endif |
| 67 | 65 |
| 68 #if defined(OS_WIN) | 66 #if defined(OS_WIN) |
| 69 #include "chrome/browser/ui/webui/conflicts_ui.h" | 67 #include "chrome/browser/ui/webui/conflicts_ui.h" |
| 70 #endif | 68 #endif |
| 71 | 69 |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 #endif // defined(OS_CHROMEOS) | 228 #endif // defined(OS_CHROMEOS) |
| 231 | 229 |
| 232 if (url.host() == chrome::kChromeUIPrintHost && | 230 if (url.host() == chrome::kChromeUIPrintHost && |
| 233 switches::IsPrintPreviewEnabled()) { | 231 switches::IsPrintPreviewEnabled()) { |
| 234 return &NewWebUI<PrintPreviewUI>; | 232 return &NewWebUI<PrintPreviewUI>; |
| 235 } | 233 } |
| 236 | 234 |
| 237 if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL) | 235 if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL) |
| 238 return &NewWebUI<ConstrainedHtmlUI>; | 236 return &NewWebUI<ConstrainedHtmlUI>; |
| 239 | 237 |
| 240 #if !defined(OS_CHROMEOS) | |
| 241 if (ProfileManager::IsMultipleProfilesEnabled()) { | |
| 242 if (url.host() == chrome::kChromeUINewProfileHost) | |
| 243 return &NewWebUI<NewProfileUI>; | |
| 244 } | |
| 245 #endif | |
| 246 | |
| 247 return NULL; | 238 return NULL; |
| 248 } | 239 } |
| 249 | 240 |
| 250 // When the test-type switch is set, return a TestType object, which should be a | 241 // When the test-type switch is set, return a TestType object, which should be a |
| 251 // subclass of Type. The logic is provided here in the traits class, rather than | 242 // subclass of Type. The logic is provided here in the traits class, rather than |
| 252 // in GetInstance() so that the choice is made only once, when the Singleton is | 243 // in GetInstance() so that the choice is made only once, when the Singleton is |
| 253 // first instantiated, rather than every time GetInstance() is called. | 244 // first instantiated, rather than every time GetInstance() is called. |
| 254 template<typename Type, typename TestType> | 245 template<typename Type, typename TestType> |
| 255 struct PossibleTestSingletonTraits : public DefaultSingletonTraits<Type> { | 246 struct PossibleTestSingletonTraits : public DefaultSingletonTraits<Type> { |
| 256 static Type* New() { | 247 static Type* New() { |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 return FlashUI::GetFaviconResourceBytes(); | 380 return FlashUI::GetFaviconResourceBytes(); |
| 390 | 381 |
| 391 if (page_url.host() == chrome::kChromeUISettingsHost) | 382 if (page_url.host() == chrome::kChromeUISettingsHost) |
| 392 return OptionsUI::GetFaviconResourceBytes(); | 383 return OptionsUI::GetFaviconResourceBytes(); |
| 393 | 384 |
| 394 if (page_url.host() == chrome::kChromeUIPluginsHost) | 385 if (page_url.host() == chrome::kChromeUIPluginsHost) |
| 395 return PluginsUI::GetFaviconResourceBytes(); | 386 return PluginsUI::GetFaviconResourceBytes(); |
| 396 | 387 |
| 397 return NULL; | 388 return NULL; |
| 398 } | 389 } |
| OLD | NEW |