Chromium Code Reviews| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 385 return &NewWebUI<UsbInternalsUI>; | 385 return &NewWebUI<UsbInternalsUI>; |
| 386 if (url.host_piece() == chrome::kChromeUIUserActionsHost) | 386 if (url.host_piece() == chrome::kChromeUIUserActionsHost) |
| 387 return &NewWebUI<UserActionsUI>; | 387 return &NewWebUI<UserActionsUI>; |
| 388 if (url.host_piece() == chrome::kChromeUIVersionHost) | 388 if (url.host_piece() == chrome::kChromeUIVersionHost) |
| 389 return &NewWebUI<VersionUI>; | 389 return &NewWebUI<VersionUI>; |
| 390 | 390 |
| 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) |
|
Lei Zhang
2017/06/09 04:22:53
Also move out of the !OS_ANDROID block. It can sta
Dan Beam
2017/06/09 06:32:55
Done.
| |
| 396 if (url.host_piece() == chrome::kChromeUISettingsFrameHost) | |
| 397 return &NewWebUI<options::OptionsUI>; | |
| 398 #else | |
| 396 // AppLauncherPage is not needed on Android or ChromeOS. | 399 // AppLauncherPage is not needed on Android or ChromeOS. |
| 397 if (url.host_piece() == chrome::kChromeUIAppLauncherPageHost && profile && | 400 if (url.host_piece() == chrome::kChromeUIAppLauncherPageHost && profile && |
| 398 extensions::ExtensionSystem::Get(profile)->extension_service()) { | 401 extensions::ExtensionSystem::Get(profile)->extension_service()) { |
| 399 return &NewWebUI<AppLauncherPageUI>; | 402 return &NewWebUI<AppLauncherPageUI>; |
| 400 } | 403 } |
| 401 #endif // !defined(OS_CHROMEOS) | 404 #endif // defined(OS_CHROMEOS) |
| 402 | 405 |
| 403 // Bookmarks are part of NTP on Android. | 406 // Bookmarks are part of NTP on Android. |
| 404 if (url.host_piece() == chrome::kChromeUIBookmarksHost) { | 407 if (url.host_piece() == chrome::kChromeUIBookmarksHost) { |
| 405 return MdBookmarksUI::IsEnabled() ? &NewWebUI<MdBookmarksUI> | 408 return MdBookmarksUI::IsEnabled() ? &NewWebUI<MdBookmarksUI> |
| 406 : &NewWebUI<BookmarksUI>; | 409 : &NewWebUI<BookmarksUI>; |
| 407 } | 410 } |
| 408 // Downloads list on Android uses the built-in download manager. | 411 // Downloads list on Android uses the built-in download manager. |
| 409 if (url.host_piece() == chrome::kChromeUIDownloadsHost) | 412 if (url.host_piece() == chrome::kChromeUIDownloadsHost) |
| 410 return &NewWebUI<MdDownloadsUI>; | 413 return &NewWebUI<MdDownloadsUI>; |
| 411 // Material Design feedback. Feedback is implemented separately in | 414 // Material Design feedback. Feedback is implemented separately in |
| 412 // Android. | 415 // Android. |
| 413 if (url.host_piece() == chrome::kChromeUIFeedbackHost && | 416 if (url.host_piece() == chrome::kChromeUIFeedbackHost && |
| 414 ::switches::MdFeedbackEnabled()) { | 417 ::switches::MdFeedbackEnabled()) { |
| 415 return &NewWebUI<MdFeedbackUI>; | 418 return &NewWebUI<MdFeedbackUI>; |
| 416 } | 419 } |
| 417 // Help is implemented with native UI elements on Android. | 420 // Help is implemented with native UI elements on Android. |
| 418 if (url.host_piece() == chrome::kChromeUIHelpFrameHost) | 421 if (url.host_piece() == chrome::kChromeUIHelpFrameHost) |
| 419 return &NewWebUI<HelpUI>; | 422 return &NewWebUI<HelpUI>; |
| 420 // Identity API is not available on Android. | 423 // Identity API is not available on Android. |
| 421 if (url.host_piece() == chrome::kChromeUIIdentityInternalsHost) | 424 if (url.host_piece() == chrome::kChromeUIIdentityInternalsHost) |
| 422 return &NewWebUI<IdentityInternalsUI>; | 425 return &NewWebUI<IdentityInternalsUI>; |
| 423 if (url.host_piece() == chrome::kChromeUINewTabHost) | 426 if (url.host_piece() == chrome::kChromeUINewTabHost) |
| 424 return &NewWebUI<NewTabUI>; | 427 return &NewWebUI<NewTabUI>; |
| 425 // Settings are implemented with native UI elements on Android. | 428 // Settings are implemented with native UI elements on Android. |
| 426 if (url.host_piece() == chrome::kChromeUISettingsHost || | 429 if (url.host_piece() == chrome::kChromeUISettingsHost || |
| 427 url.host_piece() == chrome::kChromeUIMdSettingsHost) { | 430 url.host_piece() == chrome::kChromeUIMdSettingsHost) { |
| 428 return &NewWebUI<settings::MdSettingsUI>; | 431 return &NewWebUI<settings::MdSettingsUI>; |
| 429 } | 432 } |
| 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. | 433 // If the material design extensions page is enabled, it gets its own host. |
| 433 // Otherwise, it's handled by the uber settings page. | 434 // Otherwise, it's handled by the uber settings page. |
| 434 if (url.host_piece() == chrome::kChromeUIExtensionsHost && | 435 if (url.host_piece() == chrome::kChromeUIExtensionsHost && |
| 435 base::FeatureList::IsEnabled(features::kMaterialDesignExtensions)) { | 436 base::FeatureList::IsEnabled(features::kMaterialDesignExtensions)) { |
| 436 return &NewWebUI<extensions::ExtensionsUI>; | 437 return &NewWebUI<extensions::ExtensionsUI>; |
| 437 } | 438 } |
| 438 if (url.host_piece() == chrome::kChromeUIHistoryHost) | 439 if (url.host_piece() == chrome::kChromeUIHistoryHost) |
| 439 return &NewWebUI<MdHistoryUI>; | 440 return &NewWebUI<MdHistoryUI>; |
| 440 if (url.host_piece() == chrome::kChromeUISyncFileSystemInternalsHost) | 441 if (url.host_piece() == chrome::kChromeUISyncFileSystemInternalsHost) |
| 441 return &NewWebUI<SyncFileSystemInternalsUI>; | 442 return &NewWebUI<SyncFileSystemInternalsUI>; |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 808 | 809 |
| 809 #if BUILDFLAG(ENABLE_EXTENSIONS) | 810 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 810 if (page_url.host_piece() == chrome::kChromeUIExtensionsHost || | 811 if (page_url.host_piece() == chrome::kChromeUIExtensionsHost || |
| 811 page_url.host_piece() == chrome::kChromeUIExtensionsFrameHost) | 812 page_url.host_piece() == chrome::kChromeUIExtensionsFrameHost) |
| 812 return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor); | 813 return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor); |
| 813 #endif // BUILDFLAG(ENABLE_EXTENSIONS) | 814 #endif // BUILDFLAG(ENABLE_EXTENSIONS) |
| 814 #endif // !defined(OS_ANDROID) | 815 #endif // !defined(OS_ANDROID) |
| 815 | 816 |
| 816 return NULL; | 817 return NULL; |
| 817 } | 818 } |
| OLD | NEW |