| 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/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 if (url.host() == chrome::kChromeUICloudPrintSetupHost) | 173 if (url.host() == chrome::kChromeUICloudPrintSetupHost) |
| 174 return &NewWebUI<HtmlDialogUI>; | 174 return &NewWebUI<HtmlDialogUI>; |
| 175 if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL) | 175 if (url.spec() == chrome::kChromeUIConstrainedHTMLTestURL) |
| 176 return &NewWebUI<ConstrainedHtmlUI>; | 176 return &NewWebUI<ConstrainedHtmlUI>; |
| 177 if (url.host() == chrome::kChromeUICrashesHost) | 177 if (url.host() == chrome::kChromeUICrashesHost) |
| 178 return &NewWebUI<CrashesUI>; | 178 return &NewWebUI<CrashesUI>; |
| 179 if (url.host() == chrome::kChromeUIDevToolsHost) | 179 if (url.host() == chrome::kChromeUIDevToolsHost) |
| 180 return &NewWebUI<DevToolsUI>; | 180 return &NewWebUI<DevToolsUI>; |
| 181 if (url.host() == chrome::kChromeUIDialogHost) | 181 if (url.host() == chrome::kChromeUIDialogHost) |
| 182 return &NewWebUI<ConstrainedHtmlUI>; | 182 return &NewWebUI<ConstrainedHtmlUI>; |
| 183 if (url.host() == chrome::kChromeUIDownloadsHost) | |
| 184 return &NewWebUI<DownloadsUI>; | |
| 185 if (url.host() == chrome::kChromeUIExtensionsFrameHost) | 183 if (url.host() == chrome::kChromeUIExtensionsFrameHost) |
| 186 return &NewWebUI<ExtensionsUI>; | 184 return &NewWebUI<ExtensionsUI>; |
| 187 if (url.host() == chrome::kChromeUIFeedbackHost) | 185 if (url.host() == chrome::kChromeUIFeedbackHost) |
| 188 return &NewWebUI<FeedbackUI>; | 186 return &NewWebUI<FeedbackUI>; |
| 189 if (url.host() == chrome::kChromeUIFlagsHost) | 187 if (url.host() == chrome::kChromeUIFlagsHost) |
| 190 return &NewWebUI<FlagsUI>; | 188 return &NewWebUI<FlagsUI>; |
| 191 if (url.host() == chrome::kChromeUIFlashHost) | 189 if (url.host() == chrome::kChromeUIFlashHost) |
| 192 return &NewWebUI<FlashUI>; | 190 return &NewWebUI<FlashUI>; |
| 193 if (url.host() == chrome::kChromeUIGpuInternalsHost) | 191 if (url.host() == chrome::kChromeUIGpuInternalsHost) |
| 194 return &NewWebUI<GpuInternalsUI>; | 192 return &NewWebUI<GpuInternalsUI>; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 224 return &NewWebUI<UberFrameUI>; | 222 return &NewWebUI<UberFrameUI>; |
| 225 if (url.host() == chrome::kChromeUIUberHost) | 223 if (url.host() == chrome::kChromeUIUberHost) |
| 226 return &NewWebUI<UberUI>; | 224 return &NewWebUI<UberUI>; |
| 227 if (url.host() == chrome::kChromeUIWorkersHost) | 225 if (url.host() == chrome::kChromeUIWorkersHost) |
| 228 return &NewWebUI<WorkersUI>; | 226 return &NewWebUI<WorkersUI>; |
| 229 | 227 |
| 230 /**************************************************************************** | 228 /**************************************************************************** |
| 231 * OS Specific #defines | 229 * OS Specific #defines |
| 232 ***************************************************************************/ | 230 ***************************************************************************/ |
| 233 #if !defined(OS_ANDROID) | 231 #if !defined(OS_ANDROID) |
| 234 // Android doesn't use the Options/Options2 pages | 232 // Android uses the native download manager. |
| 233 if (url.host() == chrome::kChromeUIDownloadsHost) |
| 234 return &NewWebUI<DownloadsUI>; |
| 235 // Android doesn't use the Options/Options2 pages. |
| 235 if (url.host() == chrome::kChromeUISettingsFrameHost) | 236 if (url.host() == chrome::kChromeUISettingsFrameHost) |
| 236 return &NewWebUI<options2::OptionsUI>; | 237 return &NewWebUI<options2::OptionsUI>; |
| 237 if (url.host() == chrome::kChromeUISettingsHost) | 238 if (url.host() == chrome::kChromeUISettingsHost) |
| 238 return &NewWebUI<OptionsUI>; | 239 return &NewWebUI<OptionsUI>; |
| 239 #endif | 240 #endif |
| 240 #if defined(OS_WIN) | 241 #if defined(OS_WIN) |
| 241 if (url.host() == chrome::kChromeUIConflictsHost) | 242 if (url.host() == chrome::kChromeUIConflictsHost) |
| 242 return &NewWebUI<ConflictsUI>; | 243 return &NewWebUI<ConflictsUI>; |
| 243 #endif | 244 #endif |
| 244 #if (defined(USE_NSS) || defined(USE_OPENSSL)) && defined(USE_AURA) | 245 #if (defined(USE_NSS) || defined(USE_OPENSSL)) && defined(USE_AURA) |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 return NULL; | 470 return NULL; |
| 470 | 471 |
| 471 #if defined(OS_WIN) | 472 #if defined(OS_WIN) |
| 472 if (page_url.host() == chrome::kChromeUIConflictsHost) | 473 if (page_url.host() == chrome::kChromeUIConflictsHost) |
| 473 return ConflictsUI::GetFaviconResourceBytes(); | 474 return ConflictsUI::GetFaviconResourceBytes(); |
| 474 #endif | 475 #endif |
| 475 | 476 |
| 476 if (page_url.host() == chrome::kChromeUICrashesHost) | 477 if (page_url.host() == chrome::kChromeUICrashesHost) |
| 477 return CrashesUI::GetFaviconResourceBytes(); | 478 return CrashesUI::GetFaviconResourceBytes(); |
| 478 | 479 |
| 479 if (page_url.host() == chrome::kChromeUIDownloadsHost) | |
| 480 return DownloadsUI::GetFaviconResourceBytes(); | |
| 481 | |
| 482 if (page_url.host() == chrome::kChromeUIHistoryHost) | 480 if (page_url.host() == chrome::kChromeUIHistoryHost) |
| 483 return HistoryUI::GetFaviconResourceBytes(); | 481 return HistoryUI::GetFaviconResourceBytes(); |
| 484 | 482 |
| 485 if (page_url.host() == chrome::kChromeUIFlagsHost) | 483 if (page_url.host() == chrome::kChromeUIFlagsHost) |
| 486 return FlagsUI::GetFaviconResourceBytes(); | 484 return FlagsUI::GetFaviconResourceBytes(); |
| 487 | 485 |
| 488 if (page_url.host() == chrome::kChromeUISessionsHost) | 486 if (page_url.host() == chrome::kChromeUISessionsHost) |
| 489 return SessionsUI::GetFaviconResourceBytes(); | 487 return SessionsUI::GetFaviconResourceBytes(); |
| 490 | 488 |
| 491 if (page_url.host() == chrome::kChromeUIFlashHost) | 489 if (page_url.host() == chrome::kChromeUIFlashHost) |
| 492 return FlashUI::GetFaviconResourceBytes(); | 490 return FlashUI::GetFaviconResourceBytes(); |
| 493 | 491 |
| 494 #if !defined(OS_ANDROID) | 492 #if !defined(OS_ANDROID) |
| 493 // Android uses the native download manager |
| 494 if (page_url.host() == chrome::kChromeUIDownloadsHost) |
| 495 return DownloadsUI::GetFaviconResourceBytes(); |
| 496 |
| 495 // Android doesn't use the Options/Options2 pages | 497 // Android doesn't use the Options/Options2 pages |
| 496 if (page_url.host() == chrome::kChromeUISettingsHost) | 498 if (page_url.host() == chrome::kChromeUISettingsHost) |
| 497 return OptionsUI::GetFaviconResourceBytes(); | 499 return OptionsUI::GetFaviconResourceBytes(); |
| 498 | 500 |
| 499 if (page_url.host() == chrome::kChromeUISettingsFrameHost) | 501 if (page_url.host() == chrome::kChromeUISettingsFrameHost) |
| 500 return options2::OptionsUI::GetFaviconResourceBytes(); | 502 return options2::OptionsUI::GetFaviconResourceBytes(); |
| 501 #endif | 503 #endif |
| 502 | 504 |
| 503 if (page_url.host() == chrome::kChromeUIPluginsHost) | 505 if (page_url.host() == chrome::kChromeUIPluginsHost) |
| 504 return PluginsUI::GetFaviconResourceBytes(); | 506 return PluginsUI::GetFaviconResourceBytes(); |
| 505 | 507 |
| 506 return NULL; | 508 return NULL; |
| 507 } | 509 } |
| OLD | NEW |