| 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 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "chrome/browser/ui/webui/identity_internals_ui.h" | 36 #include "chrome/browser/ui/webui/identity_internals_ui.h" |
| 37 #include "chrome/browser/ui/webui/instant_ui.h" | 37 #include "chrome/browser/ui/webui/instant_ui.h" |
| 38 #include "chrome/browser/ui/webui/interstitials/interstitial_ui.h" | 38 #include "chrome/browser/ui/webui/interstitials/interstitial_ui.h" |
| 39 #include "chrome/browser/ui/webui/invalidations_ui.h" | 39 #include "chrome/browser/ui/webui/invalidations_ui.h" |
| 40 #include "chrome/browser/ui/webui/local_state/local_state_ui.h" | 40 #include "chrome/browser/ui/webui/local_state/local_state_ui.h" |
| 41 #include "chrome/browser/ui/webui/log_web_ui_url.h" | 41 #include "chrome/browser/ui/webui/log_web_ui_url.h" |
| 42 #include "chrome/browser/ui/webui/net_export_ui.h" | 42 #include "chrome/browser/ui/webui/net_export_ui.h" |
| 43 #include "chrome/browser/ui/webui/net_internals/net_internals_ui.h" | 43 #include "chrome/browser/ui/webui/net_internals/net_internals_ui.h" |
| 44 #include "chrome/browser/ui/webui/ntp_tiles_internals_ui.h" | 44 #include "chrome/browser/ui/webui/ntp_tiles_internals_ui.h" |
| 45 #include "chrome/browser/ui/webui/omnibox/omnibox_ui.h" | 45 #include "chrome/browser/ui/webui/omnibox/omnibox_ui.h" |
| 46 #include "chrome/browser/ui/webui/options/options_ui.h" | |
| 47 #include "chrome/browser/ui/webui/password_manager_internals/password_manager_in
ternals_ui.h" | 46 #include "chrome/browser/ui/webui/password_manager_internals/password_manager_in
ternals_ui.h" |
| 48 #include "chrome/browser/ui/webui/physical_web/physical_web_ui.h" | 47 #include "chrome/browser/ui/webui/physical_web/physical_web_ui.h" |
| 49 #include "chrome/browser/ui/webui/policy_material_design_ui.h" | 48 #include "chrome/browser/ui/webui/policy_material_design_ui.h" |
| 50 #include "chrome/browser/ui/webui/policy_ui.h" | 49 #include "chrome/browser/ui/webui/policy_ui.h" |
| 51 #include "chrome/browser/ui/webui/predictors/predictors_ui.h" | 50 #include "chrome/browser/ui/webui/predictors/predictors_ui.h" |
| 52 #include "chrome/browser/ui/webui/profiler_ui.h" | 51 #include "chrome/browser/ui/webui/profiler_ui.h" |
| 53 #include "chrome/browser/ui/webui/quota_internals/quota_internals_ui.h" | 52 #include "chrome/browser/ui/webui/quota_internals/quota_internals_ui.h" |
| 54 #include "chrome/browser/ui/webui/settings/md_settings_ui.h" | 53 #include "chrome/browser/ui/webui/settings/md_settings_ui.h" |
| 55 #include "chrome/browser/ui/webui/settings_utils.h" | 54 #include "chrome/browser/ui/webui/settings_utils.h" |
| 56 #include "chrome/browser/ui/webui/signin_internals_ui.h" | 55 #include "chrome/browser/ui/webui/signin_internals_ui.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 #include "chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.h" | 139 #include "chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.h" |
| 141 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 140 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
| 142 #include "chrome/browser/ui/webui/chromeos/mobile_setup_ui.h" | 141 #include "chrome/browser/ui/webui/chromeos/mobile_setup_ui.h" |
| 143 #include "chrome/browser/ui/webui/chromeos/network_ui.h" | 142 #include "chrome/browser/ui/webui/chromeos/network_ui.h" |
| 144 #include "chrome/browser/ui/webui/chromeos/power_ui.h" | 143 #include "chrome/browser/ui/webui/chromeos/power_ui.h" |
| 145 #include "chrome/browser/ui/webui/chromeos/proxy_settings_ui.h" | 144 #include "chrome/browser/ui/webui/chromeos/proxy_settings_ui.h" |
| 146 #include "chrome/browser/ui/webui/chromeos/set_time_ui.h" | 145 #include "chrome/browser/ui/webui/chromeos/set_time_ui.h" |
| 147 #include "chrome/browser/ui/webui/chromeos/sim_unlock_ui.h" | 146 #include "chrome/browser/ui/webui/chromeos/sim_unlock_ui.h" |
| 148 #include "chrome/browser/ui/webui/chromeos/slow_trace_ui.h" | 147 #include "chrome/browser/ui/webui/chromeos/slow_trace_ui.h" |
| 149 #include "chrome/browser/ui/webui/chromeos/slow_ui.h" | 148 #include "chrome/browser/ui/webui/chromeos/slow_ui.h" |
| 149 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 150 #include "chrome/browser/ui/webui/voice_search_ui.h" | 150 #include "chrome/browser/ui/webui/voice_search_ui.h" |
| 151 #include "components/proximity_auth/webui/proximity_auth_ui.h" | 151 #include "components/proximity_auth/webui/proximity_auth_ui.h" |
| 152 #include "components/proximity_auth/webui/url_constants.h" | 152 #include "components/proximity_auth/webui/url_constants.h" |
| 153 #endif | 153 #endif |
| 154 | 154 |
| 155 #if defined(OS_CHROMEOS) && !defined(OFFICIAL_BUILD) | 155 #if defined(OS_CHROMEOS) && !defined(OFFICIAL_BUILD) |
| 156 #include "chrome/browser/ui/webui/chromeos/emulator/device_emulator_ui.h" | 156 #include "chrome/browser/ui/webui/chromeos/emulator/device_emulator_ui.h" |
| 157 #endif | 157 #endif |
| 158 | 158 |
| 159 #if !defined(OS_CHROMEOS) | 159 #if !defined(OS_CHROMEOS) |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 /**************************************************************************** | 391 /**************************************************************************** |
| 392 * OS Specific #defines | 392 * OS Specific #defines |
| 393 ***************************************************************************/ | 393 ***************************************************************************/ |
| 394 #if !defined(OS_ANDROID) | 394 #if !defined(OS_ANDROID) |
| 395 #if !defined(OS_CHROMEOS) | 395 #if !defined(OS_CHROMEOS) |
| 396 // AppLauncherPage is not needed on Android or ChromeOS. | 396 // AppLauncherPage is not needed on Android or ChromeOS. |
| 397 if (url.host_piece() == chrome::kChromeUIAppLauncherPageHost && profile && | 397 if (url.host_piece() == chrome::kChromeUIAppLauncherPageHost && profile && |
| 398 extensions::ExtensionSystem::Get(profile)->extension_service()) { | 398 extensions::ExtensionSystem::Get(profile)->extension_service()) { |
| 399 return &NewWebUI<AppLauncherPageUI>; | 399 return &NewWebUI<AppLauncherPageUI>; |
| 400 } | 400 } |
| 401 #endif // !defined(OS_CHROMEOS) | 401 #endif // defined(OS_CHROMEOS) |
| 402 | 402 |
| 403 // Bookmarks are part of NTP on Android. | 403 // Bookmarks are part of NTP on Android. |
| 404 if (url.host_piece() == chrome::kChromeUIBookmarksHost) { | 404 if (url.host_piece() == chrome::kChromeUIBookmarksHost) { |
| 405 return MdBookmarksUI::IsEnabled() ? &NewWebUI<MdBookmarksUI> | 405 return MdBookmarksUI::IsEnabled() ? &NewWebUI<MdBookmarksUI> |
| 406 : &NewWebUI<BookmarksUI>; | 406 : &NewWebUI<BookmarksUI>; |
| 407 } | 407 } |
| 408 // Downloads list on Android uses the built-in download manager. | 408 // Downloads list on Android uses the built-in download manager. |
| 409 if (url.host_piece() == chrome::kChromeUIDownloadsHost) | 409 if (url.host_piece() == chrome::kChromeUIDownloadsHost) |
| 410 return &NewWebUI<MdDownloadsUI>; | 410 return &NewWebUI<MdDownloadsUI>; |
| 411 // Material Design feedback. Feedback is implemented separately in | 411 // Material Design feedback. Feedback is implemented separately in |
| 412 // Android. | 412 // Android. |
| 413 if (url.host_piece() == chrome::kChromeUIFeedbackHost && | 413 if (url.host_piece() == chrome::kChromeUIFeedbackHost && |
| 414 ::switches::MdFeedbackEnabled()) { | 414 ::switches::MdFeedbackEnabled()) { |
| 415 return &NewWebUI<MdFeedbackUI>; | 415 return &NewWebUI<MdFeedbackUI>; |
| 416 } | 416 } |
| 417 // Help is implemented with native UI elements on Android. | 417 // Help is implemented with native UI elements on Android. |
| 418 if (url.host_piece() == chrome::kChromeUIHelpFrameHost) | 418 if (url.host_piece() == chrome::kChromeUIHelpFrameHost) |
| 419 return &NewWebUI<HelpUI>; | 419 return &NewWebUI<HelpUI>; |
| 420 // Identity API is not available on Android. | 420 // Identity API is not available on Android. |
| 421 if (url.host_piece() == chrome::kChromeUIIdentityInternalsHost) | 421 if (url.host_piece() == chrome::kChromeUIIdentityInternalsHost) |
| 422 return &NewWebUI<IdentityInternalsUI>; | 422 return &NewWebUI<IdentityInternalsUI>; |
| 423 if (url.host_piece() == chrome::kChromeUINewTabHost) | 423 if (url.host_piece() == chrome::kChromeUINewTabHost) |
| 424 return &NewWebUI<NewTabUI>; | 424 return &NewWebUI<NewTabUI>; |
| 425 // Settings are implemented with native UI elements on Android. | 425 // Settings are implemented with native UI elements on Android. |
| 426 if (url.host_piece() == chrome::kChromeUISettingsHost || | 426 if (url.host_piece() == chrome::kChromeUISettingsHost || |
| 427 url.host_piece() == chrome::kChromeUIMdSettingsHost) { | 427 url.host_piece() == chrome::kChromeUIMdSettingsHost) { |
| 428 return &NewWebUI<settings::MdSettingsUI>; | 428 return &NewWebUI<settings::MdSettingsUI>; |
| 429 } | 429 } |
| 430 if (url.host_piece() == chrome::kChromeUISettingsFrameHost) | |
| 431 return &NewWebUI<options::OptionsUI>; | |
| 432 // If the material design extensions page is enabled, it gets its own host. | 430 // If the material design extensions page is enabled, it gets its own host. |
| 433 // Otherwise, it's handled by the uber settings page. | 431 // Otherwise, it's handled by the uber settings page. |
| 434 if (url.host_piece() == chrome::kChromeUIExtensionsHost && | 432 if (url.host_piece() == chrome::kChromeUIExtensionsHost && |
| 435 base::FeatureList::IsEnabled(features::kMaterialDesignExtensions)) { | 433 base::FeatureList::IsEnabled(features::kMaterialDesignExtensions)) { |
| 436 return &NewWebUI<extensions::ExtensionsUI>; | 434 return &NewWebUI<extensions::ExtensionsUI>; |
| 437 } | 435 } |
| 438 if (url.host_piece() == chrome::kChromeUIHistoryHost) | 436 if (url.host_piece() == chrome::kChromeUIHistoryHost) |
| 439 return &NewWebUI<MdHistoryUI>; | 437 return &NewWebUI<MdHistoryUI>; |
| 440 if (url.host_piece() == chrome::kChromeUISyncFileSystemInternalsHost) | 438 if (url.host_piece() == chrome::kChromeUISyncFileSystemInternalsHost) |
| 441 return &NewWebUI<SyncFileSystemInternalsUI>; | 439 return &NewWebUI<SyncFileSystemInternalsUI>; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 if (url.host_piece() == chrome::kChromeUIOobeHost) | 474 if (url.host_piece() == chrome::kChromeUIOobeHost) |
| 477 return &NewWebUI<chromeos::OobeUI>; | 475 return &NewWebUI<chromeos::OobeUI>; |
| 478 if (url.host_piece() == chrome::kChromeUIPowerHost) | 476 if (url.host_piece() == chrome::kChromeUIPowerHost) |
| 479 return &NewWebUI<chromeos::PowerUI>; | 477 return &NewWebUI<chromeos::PowerUI>; |
| 480 if (url.host_piece() == proximity_auth::kChromeUIProximityAuthHost) | 478 if (url.host_piece() == proximity_auth::kChromeUIProximityAuthHost) |
| 481 return &NewWebUI<proximity_auth::ProximityAuthUI>; | 479 return &NewWebUI<proximity_auth::ProximityAuthUI>; |
| 482 if (url.host_piece() == chrome::kChromeUIProxySettingsHost) | 480 if (url.host_piece() == chrome::kChromeUIProxySettingsHost) |
| 483 return &NewWebUI<chromeos::ProxySettingsUI>; | 481 return &NewWebUI<chromeos::ProxySettingsUI>; |
| 484 if (url.host_piece() == chrome::kChromeUISetTimeHost) | 482 if (url.host_piece() == chrome::kChromeUISetTimeHost) |
| 485 return &NewWebUI<chromeos::SetTimeUI>; | 483 return &NewWebUI<chromeos::SetTimeUI>; |
| 484 if (url.host_piece() == chrome::kChromeUISettingsFrameHost) |
| 485 return &NewWebUI<options::OptionsUI>; |
| 486 if (url.host_piece() == chrome::kChromeUISimUnlockHost) | 486 if (url.host_piece() == chrome::kChromeUISimUnlockHost) |
| 487 return &NewWebUI<chromeos::SimUnlockUI>; | 487 return &NewWebUI<chromeos::SimUnlockUI>; |
| 488 if (url.host_piece() == chrome::kChromeUISlowHost) | 488 if (url.host_piece() == chrome::kChromeUISlowHost) |
| 489 return &NewWebUI<chromeos::SlowUI>; | 489 return &NewWebUI<chromeos::SlowUI>; |
| 490 if (url.host_piece() == chrome::kChromeUISlowTraceHost) | 490 if (url.host_piece() == chrome::kChromeUISlowTraceHost) |
| 491 return &NewWebUI<chromeos::SlowTraceController>; | 491 return &NewWebUI<chromeos::SlowTraceController>; |
| 492 if (url.host_piece() == chrome::kChromeUIVoiceSearchHost) | 492 if (url.host_piece() == chrome::kChromeUIVoiceSearchHost) |
| 493 return &NewWebUI<VoiceSearchUI>; | 493 return &NewWebUI<VoiceSearchUI>; |
| 494 #if !defined(OFFICIAL_BUILD) | 494 #if !defined(OFFICIAL_BUILD) |
| 495 if (!base::SysInfo::IsRunningOnChromeOS()) { | 495 if (!base::SysInfo::IsRunningOnChromeOS()) { |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 808 | 808 |
| 809 #if BUILDFLAG(ENABLE_EXTENSIONS) | 809 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 810 if (page_url.host_piece() == chrome::kChromeUIExtensionsHost || | 810 if (page_url.host_piece() == chrome::kChromeUIExtensionsHost || |
| 811 page_url.host_piece() == chrome::kChromeUIExtensionsFrameHost) | 811 page_url.host_piece() == chrome::kChromeUIExtensionsFrameHost) |
| 812 return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor); | 812 return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor); |
| 813 #endif // BUILDFLAG(ENABLE_EXTENSIONS) | 813 #endif // BUILDFLAG(ENABLE_EXTENSIONS) |
| 814 #endif // !defined(OS_ANDROID) | 814 #endif // !defined(OS_ANDROID) |
| 815 | 815 |
| 816 return NULL; | 816 return NULL; |
| 817 } | 817 } |
| OLD | NEW |