| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/dom_ui/dom_ui_factory.h" | 5 #include "chrome/browser/dom_ui/dom_ui_factory.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/chrome_thread.h" | 8 #include "chrome/browser/chrome_thread.h" |
| 9 #include "chrome/browser/dom_ui/bookmarks_ui.h" | 9 #include "chrome/browser/dom_ui/bookmarks_ui.h" |
| 10 #include "chrome/browser/dom_ui/bug_report_ui.h" | 10 #include "chrome/browser/dom_ui/bug_report_ui.h" |
| 11 #include "chrome/browser/dom_ui/downloads_ui.h" | 11 #include "chrome/browser/dom_ui/downloads_ui.h" |
| 12 #include "chrome/browser/dom_ui/devtools_ui.h" | 12 #include "chrome/browser/dom_ui/devtools_ui.h" |
| 13 #include "chrome/browser/dom_ui/history_ui.h" | 13 #include "chrome/browser/dom_ui/history_ui.h" |
| 14 #include "chrome/browser/dom_ui/history2_ui.h" | 14 #include "chrome/browser/dom_ui/history2_ui.h" |
| 15 #include "chrome/browser/dom_ui/html_dialog_ui.h" | 15 #include "chrome/browser/dom_ui/html_dialog_ui.h" |
| 16 #include "chrome/browser/dom_ui/labs_ui.h" |
| 16 #include "chrome/browser/dom_ui/net_internals_ui.h" | 17 #include "chrome/browser/dom_ui/net_internals_ui.h" |
| 17 #include "chrome/browser/dom_ui/new_tab_ui.h" | 18 #include "chrome/browser/dom_ui/new_tab_ui.h" |
| 18 #include "chrome/browser/dom_ui/options_ui.h" | 19 #include "chrome/browser/dom_ui/options_ui.h" |
| 19 #include "chrome/browser/dom_ui/remoting_ui.h" | 20 #include "chrome/browser/dom_ui/remoting_ui.h" |
| 20 #include "chrome/browser/dom_ui/plugins_ui.h" | 21 #include "chrome/browser/dom_ui/plugins_ui.h" |
| 21 #include "chrome/browser/dom_ui/slideshow_ui.h" | 22 #include "chrome/browser/dom_ui/slideshow_ui.h" |
| 22 #include "chrome/browser/extensions/extension_dom_ui.h" | 23 #include "chrome/browser/extensions/extension_dom_ui.h" |
| 23 #include "chrome/browser/extensions/extensions_service.h" | 24 #include "chrome/browser/extensions/extensions_service.h" |
| 24 #include "chrome/browser/extensions/extensions_ui.h" | 25 #include "chrome/browser/extensions/extensions_ui.h" |
| 26 #include "chrome/browser/labs.h" |
| 25 #include "chrome/browser/printing/print_dialog_cloud.h" | 27 #include "chrome/browser/printing/print_dialog_cloud.h" |
| 26 #include "chrome/browser/profile.h" | 28 #include "chrome/browser/profile.h" |
| 27 #include "chrome/browser/tab_contents/tab_contents.h" | 29 #include "chrome/browser/tab_contents/tab_contents.h" |
| 28 #include "chrome/common/chrome_switches.h" | 30 #include "chrome/common/chrome_switches.h" |
| 29 #include "chrome/common/extensions/extension_constants.h" | 31 #include "chrome/common/extensions/extension_constants.h" |
| 30 #include "chrome/common/url_constants.h" | 32 #include "chrome/common/url_constants.h" |
| 31 #include "googleurl/src/gurl.h" | 33 #include "googleurl/src/gurl.h" |
| 32 | 34 |
| 33 #if defined(OS_CHROMEOS) | 35 #if defined(OS_CHROMEOS) |
| 34 #include "chrome/browser/chromeos/dom_ui/imageburner_ui.h" | 36 #include "chrome/browser/chromeos/dom_ui/imageburner_ui.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 if (url.host() == chrome::kChromeUIDevToolsHost) | 111 if (url.host() == chrome::kChromeUIDevToolsHost) |
| 110 return &NewDOMUI<DevToolsUI>; | 112 return &NewDOMUI<DevToolsUI>; |
| 111 if (url.host() == chrome::kChromeUIDownloadsHost) | 113 if (url.host() == chrome::kChromeUIDownloadsHost) |
| 112 return &NewDOMUI<DownloadsUI>; | 114 return &NewDOMUI<DownloadsUI>; |
| 113 if (url.host() == chrome::kChromeUIExtensionsHost) | 115 if (url.host() == chrome::kChromeUIExtensionsHost) |
| 114 return &NewDOMUI<ExtensionsUI>; | 116 return &NewDOMUI<ExtensionsUI>; |
| 115 if (url.host() == chrome::kChromeUIHistoryHost) | 117 if (url.host() == chrome::kChromeUIHistoryHost) |
| 116 return &NewDOMUI<HistoryUI>; | 118 return &NewDOMUI<HistoryUI>; |
| 117 if (url.host() == chrome::kChromeUIHistory2Host) | 119 if (url.host() == chrome::kChromeUIHistory2Host) |
| 118 return &NewDOMUI<HistoryUI2>; | 120 return &NewDOMUI<HistoryUI2>; |
| 121 if (about_labs::IsEnabled() && url.host() == chrome::kChromeUILabsHost) |
| 122 return &NewDOMUI<LabsUI>; |
| 119 if (url.host() == chrome::kChromeUINetInternalsHost) | 123 if (url.host() == chrome::kChromeUINetInternalsHost) |
| 120 return &NewDOMUI<NetInternalsUI>; | 124 return &NewDOMUI<NetInternalsUI>; |
| 121 if (url.host() == chrome::kChromeUIPluginsHost) | 125 if (url.host() == chrome::kChromeUIPluginsHost) |
| 122 return &NewDOMUI<PluginsUI>; | 126 return &NewDOMUI<PluginsUI>; |
| 123 #if defined(ENABLE_REMOTING) | 127 #if defined(ENABLE_REMOTING) |
| 124 if (url.host() == chrome::kChromeUIRemotingHost) { | 128 if (url.host() == chrome::kChromeUIRemotingHost) { |
| 125 if (CommandLine::ForCurrentProcess()->HasSwitch( | 129 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 126 switches::kEnableRemoting)) { | 130 switches::kEnableRemoting)) { |
| 127 return &NewDOMUI<RemotingUI>; | 131 return &NewDOMUI<RemotingUI>; |
| 128 } | 132 } |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 226 |
| 223 if (page_url.host() == chrome::kChromeUIExtensionsHost) | 227 if (page_url.host() == chrome::kChromeUIExtensionsHost) |
| 224 return ExtensionsUI::GetFaviconResourceBytes(); | 228 return ExtensionsUI::GetFaviconResourceBytes(); |
| 225 | 229 |
| 226 if (page_url.host() == chrome::kChromeUIHistoryHost) | 230 if (page_url.host() == chrome::kChromeUIHistoryHost) |
| 227 return HistoryUI::GetFaviconResourceBytes(); | 231 return HistoryUI::GetFaviconResourceBytes(); |
| 228 | 232 |
| 229 if (page_url.host() == chrome::kChromeUIHistory2Host) | 233 if (page_url.host() == chrome::kChromeUIHistory2Host) |
| 230 return HistoryUI2::GetFaviconResourceBytes(); | 234 return HistoryUI2::GetFaviconResourceBytes(); |
| 231 | 235 |
| 236 if (about_labs::IsEnabled() && page_url.host() == chrome::kChromeUILabsHost) |
| 237 return LabsUI::GetFaviconResourceBytes(); |
| 238 |
| 232 if (page_url.host() == chrome::kChromeUIOptionsHost) | 239 if (page_url.host() == chrome::kChromeUIOptionsHost) |
| 233 return OptionsUI::GetFaviconResourceBytes(); | 240 return OptionsUI::GetFaviconResourceBytes(); |
| 234 | 241 |
| 235 if (page_url.host() == chrome::kChromeUIPluginsHost) | 242 if (page_url.host() == chrome::kChromeUIPluginsHost) |
| 236 return PluginsUI::GetFaviconResourceBytes(); | 243 return PluginsUI::GetFaviconResourceBytes(); |
| 237 | 244 |
| 238 #if defined(ENABLE_REMOTING) | 245 #if defined(ENABLE_REMOTING) |
| 239 if (page_url.host() == chrome::kChromeUIRemotingHost) | 246 if (page_url.host() == chrome::kChromeUIRemotingHost) |
| 240 return RemotingUI::GetFaviconResourceBytes(); | 247 return RemotingUI::GetFaviconResourceBytes(); |
| 241 #endif | 248 #endif |
| 242 | 249 |
| 243 return NULL; | 250 return NULL; |
| 244 } | 251 } |
| OLD | NEW |