| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/location.h" | 13 #include "base/location.h" |
| 14 #include "base/thread_task_runner_handle.h" | 14 #include "base/thread_task_runner_handle.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 #include "chrome/browser/about_flags.h" | 16 #include "chrome/browser/about_flags.h" |
| 17 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" | 17 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
| 18 #include "chrome/browser/engagement/site_engagement_service.h" | 18 #include "chrome/browser/engagement/site_engagement_service.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/browser/profiles/profile_manager.h" | 20 #include "chrome/browser/profiles/profile_manager.h" |
| 21 #include "chrome/browser/ui/webui/about_ui.h" | 21 #include "chrome/browser/ui/webui/about_ui.h" |
| 22 #include "chrome/browser/ui/webui/bookmarks_ui.h" | 22 #include "chrome/browser/ui/webui/bookmarks_ui.h" |
| 23 #include "chrome/browser/ui/webui/components_ui.h" | 23 #include "chrome/browser/ui/webui/components_ui.h" |
| 24 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" | 24 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" |
| 25 #include "chrome/browser/ui/webui/crashes_ui.h" | 25 #include "chrome/browser/ui/webui/crashes_ui.h" |
| 26 #include "chrome/browser/ui/webui/device_log_ui.h" | 26 #include "chrome/browser/ui/webui/device_log_ui.h" |
| 27 #include "chrome/browser/ui/webui/domain_reliability_internals_ui.h" | 27 #include "chrome/browser/ui/webui/domain_reliability_internals_ui.h" |
| 28 #include "chrome/browser/ui/webui/downloads_ui.h" | |
| 29 #include "chrome/browser/ui/webui/downloads_util.h" | |
| 30 #include "chrome/browser/ui/webui/flags_ui.h" | 28 #include "chrome/browser/ui/webui/flags_ui.h" |
| 31 #include "chrome/browser/ui/webui/flash_ui.h" | 29 #include "chrome/browser/ui/webui/flash_ui.h" |
| 32 #include "chrome/browser/ui/webui/gcm_internals_ui.h" | 30 #include "chrome/browser/ui/webui/gcm_internals_ui.h" |
| 33 #include "chrome/browser/ui/webui/help/help_ui.h" | 31 #include "chrome/browser/ui/webui/help/help_ui.h" |
| 34 #include "chrome/browser/ui/webui/history_ui.h" | 32 #include "chrome/browser/ui/webui/history_ui.h" |
| 35 #include "chrome/browser/ui/webui/identity_internals_ui.h" | 33 #include "chrome/browser/ui/webui/identity_internals_ui.h" |
| 36 #include "chrome/browser/ui/webui/instant_ui.h" | 34 #include "chrome/browser/ui/webui/instant_ui.h" |
| 37 #include "chrome/browser/ui/webui/interstitials/interstitial_ui.h" | 35 #include "chrome/browser/ui/webui/interstitials/interstitial_ui.h" |
| 38 #include "chrome/browser/ui/webui/invalidations_ui.h" | 36 #include "chrome/browser/ui/webui/invalidations_ui.h" |
| 39 #include "chrome/browser/ui/webui/local_state/local_state_ui.h" | 37 #include "chrome/browser/ui/webui/local_state/local_state_ui.h" |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 profile && extensions::ExtensionSystem::Get(profile)-> | 387 profile && extensions::ExtensionSystem::Get(profile)-> |
| 390 extension_service()) { | 388 extension_service()) { |
| 391 return &NewWebUI<AppLauncherPageUI>; | 389 return &NewWebUI<AppLauncherPageUI>; |
| 392 } | 390 } |
| 393 #endif | 391 #endif |
| 394 | 392 |
| 395 // Bookmarks are part of NTP on Android. | 393 // Bookmarks are part of NTP on Android. |
| 396 if (url.host() == chrome::kChromeUIBookmarksHost) | 394 if (url.host() == chrome::kChromeUIBookmarksHost) |
| 397 return &NewWebUI<BookmarksUI>; | 395 return &NewWebUI<BookmarksUI>; |
| 398 // Downloads list on Android uses the built-in download manager. | 396 // Downloads list on Android uses the built-in download manager. |
| 399 if (url.host() == chrome::kChromeUIDownloadsHost) { | 397 if (url.host() == chrome::kChromeUIDownloadsHost) |
| 400 if (MdDownloadsEnabled()) | 398 return &NewWebUI<MdDownloadsUI>; |
| 401 return &NewWebUI<MdDownloadsUI>; | |
| 402 return &NewWebUI<DownloadsUI>; | |
| 403 } | |
| 404 // Help is implemented with native UI elements on Android. | 399 // Help is implemented with native UI elements on Android. |
| 405 if (url.host() == chrome::kChromeUIHelpFrameHost) | 400 if (url.host() == chrome::kChromeUIHelpFrameHost) |
| 406 return &NewWebUI<HelpUI>; | 401 return &NewWebUI<HelpUI>; |
| 407 // Identity API is not available on Android. | 402 // Identity API is not available on Android. |
| 408 if (url.host() == chrome::kChromeUIIdentityInternalsHost) | 403 if (url.host() == chrome::kChromeUIIdentityInternalsHost) |
| 409 return &NewWebUI<IdentityInternalsUI>; | 404 return &NewWebUI<IdentityInternalsUI>; |
| 410 if (url.host() == chrome::kChromeUINewTabHost) | 405 if (url.host() == chrome::kChromeUINewTabHost) |
| 411 return &NewWebUI<NewTabUI>; | 406 return &NewWebUI<NewTabUI>; |
| 412 if (url.host() == chrome::kChromeUIMdSettingsHost) | 407 if (url.host() == chrome::kChromeUIMdSettingsHost) |
| 413 return &NewWebUI<settings::MdSettingsUI>; | 408 return &NewWebUI<settings::MdSettingsUI>; |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 773 if (page_url.host() == chrome::kChromeUIAppLauncherPageHost) | 768 if (page_url.host() == chrome::kChromeUIAppLauncherPageHost) |
| 774 return AppLauncherPageUI::GetFaviconResourceBytes(scale_factor); | 769 return AppLauncherPageUI::GetFaviconResourceBytes(scale_factor); |
| 775 #endif | 770 #endif |
| 776 | 771 |
| 777 // Flash is not available on android. | 772 // Flash is not available on android. |
| 778 if (page_url.host() == chrome::kChromeUIFlashHost) | 773 if (page_url.host() == chrome::kChromeUIFlashHost) |
| 779 return FlashUI::GetFaviconResourceBytes(scale_factor); | 774 return FlashUI::GetFaviconResourceBytes(scale_factor); |
| 780 | 775 |
| 781 // Android uses the native download manager. | 776 // Android uses the native download manager. |
| 782 if (page_url.host() == chrome::kChromeUIDownloadsHost) | 777 if (page_url.host() == chrome::kChromeUIDownloadsHost) |
| 783 return DownloadsUI::GetFaviconResourceBytes(scale_factor); | 778 return MdDownloadsUI::GetFaviconResourceBytes(scale_factor); |
| 784 | 779 |
| 785 // Android doesn't use the Options pages. | 780 // Android doesn't use the Options pages. |
| 786 if (page_url.host() == chrome::kChromeUISettingsHost || | 781 if (page_url.host() == chrome::kChromeUISettingsHost || |
| 787 page_url.host() == chrome::kChromeUISettingsFrameHost) | 782 page_url.host() == chrome::kChromeUISettingsFrameHost) |
| 788 return options::OptionsUI::GetFaviconResourceBytes(scale_factor); | 783 return options::OptionsUI::GetFaviconResourceBytes(scale_factor); |
| 789 | 784 |
| 790 #if defined(ENABLE_EXTENSIONS) | 785 #if defined(ENABLE_EXTENSIONS) |
| 791 if (page_url.host() == chrome::kChromeUIExtensionsHost || | 786 if (page_url.host() == chrome::kChromeUIExtensionsHost || |
| 792 page_url.host() == chrome::kChromeUIExtensionsFrameHost) | 787 page_url.host() == chrome::kChromeUIExtensionsFrameHost) |
| 793 return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor); | 788 return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor); |
| 794 #endif | 789 #endif |
| 795 | 790 |
| 796 // Android doesn't use the plugins pages. | 791 // Android doesn't use the plugins pages. |
| 797 if (page_url.host() == chrome::kChromeUIPluginsHost) | 792 if (page_url.host() == chrome::kChromeUIPluginsHost) |
| 798 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 793 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
| 799 | 794 |
| 800 #endif | 795 #endif |
| 801 | 796 |
| 802 return NULL; | 797 return NULL; |
| 803 } | 798 } |
| OLD | NEW |