| 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" | 
|   11 #include "chrome/browser/extensions/extensions_ui.h" |   11 #include "chrome/browser/extensions/extensions_ui.h" | 
|   12 #include "chrome/browser/history/history_types.h" |   12 #include "chrome/browser/history/history_types.h" | 
|   13 #include "chrome/browser/profiles/profile.h" |   13 #include "chrome/browser/profiles/profile.h" | 
 |   14 #include "chrome/browser/profiles/profile_manager.h" | 
|   14 #include "chrome/browser/ui/webui/bookmarks_ui.h" |   15 #include "chrome/browser/ui/webui/bookmarks_ui.h" | 
|   15 #include "chrome/browser/ui/webui/bug_report_ui.h" |   16 #include "chrome/browser/ui/webui/bug_report_ui.h" | 
|   16 #include "chrome/browser/ui/webui/constrained_html_ui.h" |   17 #include "chrome/browser/ui/webui/constrained_html_ui.h" | 
|   17 #include "chrome/browser/ui/webui/crashes_ui.h" |   18 #include "chrome/browser/ui/webui/crashes_ui.h" | 
|   18 #include "chrome/browser/ui/webui/devtools_ui.h" |   19 #include "chrome/browser/ui/webui/devtools_ui.h" | 
|   19 #include "chrome/browser/ui/webui/downloads_ui.h" |   20 #include "chrome/browser/ui/webui/downloads_ui.h" | 
|   20 #include "chrome/browser/ui/webui/task_manager_ui.h" |   21 #include "chrome/browser/ui/webui/task_manager_ui.h" | 
|   21 #include "chrome/browser/ui/webui/flags_ui.h" |   22 #include "chrome/browser/ui/webui/flags_ui.h" | 
|   22 #include "chrome/browser/ui/webui/flash_ui.h" |   23 #include "chrome/browser/ui/webui/flash_ui.h" | 
|   23 #include "chrome/browser/ui/webui/gpu_internals_ui.h" |   24 #include "chrome/browser/ui/webui/gpu_internals_ui.h" | 
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  221   if (url.host() == chrome::kChromeUIPrintHost && |  222   if (url.host() == chrome::kChromeUIPrintHost && | 
|  222       switches::IsPrintPreviewEnabled()) { |  223       switches::IsPrintPreviewEnabled()) { | 
|  223     return &NewWebUI<PrintPreviewUI>; |  224     return &NewWebUI<PrintPreviewUI>; | 
|  224   } |  225   } | 
|  225 #endif  // defined(OS_CHROMEOS) |  226 #endif  // defined(OS_CHROMEOS) | 
|  226  |  227  | 
|  227   if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL) |  228   if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL) | 
|  228     return &NewWebUI<ConstrainedHtmlUI>; |  229     return &NewWebUI<ConstrainedHtmlUI>; | 
|  229  |  230  | 
|  230 #if !defined(OS_CHROMEOS) |  231 #if !defined(OS_CHROMEOS) | 
|  231   if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles)) { |  232   if (ProfileManager::IsMultipleProfilesEnabled()) { | 
|  232     if (url.host() == chrome::kChromeUINewProfileHost) |  233     if (url.host() == chrome::kChromeUINewProfileHost) | 
|  233       return &NewWebUI<NewProfileUI>; |  234       return &NewWebUI<NewProfileUI>; | 
|  234   } |  235   } | 
|  235 #endif |  236 #endif | 
|  236  |  237  | 
|  237   return NULL; |  238   return NULL; | 
|  238 } |  239 } | 
|  239  |  240  | 
|  240 // 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 | 
|  241 // 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 | 
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  377     return FlashUI::GetFaviconResourceBytes(); |  378     return FlashUI::GetFaviconResourceBytes(); | 
|  378  |  379  | 
|  379   if (page_url.host() == chrome::kChromeUISettingsHost) |  380   if (page_url.host() == chrome::kChromeUISettingsHost) | 
|  380     return OptionsUI::GetFaviconResourceBytes(); |  381     return OptionsUI::GetFaviconResourceBytes(); | 
|  381  |  382  | 
|  382   if (page_url.host() == chrome::kChromeUIPluginsHost) |  383   if (page_url.host() == chrome::kChromeUIPluginsHost) | 
|  383     return PluginsUI::GetFaviconResourceBytes(); |  384     return PluginsUI::GetFaviconResourceBytes(); | 
|  384  |  385  | 
|  385   return NULL; |  386   return NULL; | 
|  386 } |  387 } | 
| OLD | NEW |