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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 #include "components/dom_distiller/core/dom_distiller_features.h" | 68 #include "components/dom_distiller/core/dom_distiller_features.h" |
69 #include "components/dom_distiller/core/dom_distiller_service.h" | 69 #include "components/dom_distiller/core/dom_distiller_service.h" |
70 #include "components/dom_distiller/core/url_constants.h" | 70 #include "components/dom_distiller/core/url_constants.h" |
71 #include "components/dom_distiller/webui/dom_distiller_ui.h" | 71 #include "components/dom_distiller/webui/dom_distiller_ui.h" |
72 #include "components/favicon/core/favicon_service.h" | 72 #include "components/favicon/core/favicon_service.h" |
73 #include "components/favicon_base/favicon_util.h" | 73 #include "components/favicon_base/favicon_util.h" |
74 #include "components/favicon_base/select_favicon_frames.h" | 74 #include "components/favicon_base/select_favicon_frames.h" |
75 #include "components/history/core/browser/history_types.h" | 75 #include "components/history/core/browser/history_types.h" |
76 #include "components/prefs/pref_service.h" | 76 #include "components/prefs/pref_service.h" |
77 #include "components/signin/core/common/profile_management_switches.h" | 77 #include "components/signin/core/common/profile_management_switches.h" |
| 78 #include "components/signin/core/common/signin_features.h" |
78 #include "content/public/browser/web_contents.h" | 79 #include "content/public/browser/web_contents.h" |
79 #include "content/public/browser/web_ui.h" | 80 #include "content/public/browser/web_ui.h" |
80 #include "content/public/common/content_client.h" | 81 #include "content/public/common/content_client.h" |
81 #include "content/public/common/url_utils.h" | 82 #include "content/public/common/url_utils.h" |
82 #include "extensions/features/features.h" | 83 #include "extensions/features/features.h" |
83 #include "media/media_features.h" | 84 #include "media/media_features.h" |
84 #include "ppapi/features/features.h" | 85 #include "ppapi/features/features.h" |
85 #include "printing/features/features.h" | 86 #include "printing/features/features.h" |
86 #include "ui/gfx/favicon_size.h" | 87 #include "ui/gfx/favicon_size.h" |
87 #include "ui/web_dialogs/web_dialog_ui.h" | 88 #include "ui/web_dialogs/web_dialog_ui.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 #endif | 156 #endif |
156 | 157 |
157 #if !defined(OS_CHROMEOS) | 158 #if !defined(OS_CHROMEOS) |
158 #include "chrome/browser/ui/webui/app_launcher_page_ui.h" | 159 #include "chrome/browser/ui/webui/app_launcher_page_ui.h" |
159 #endif | 160 #endif |
160 | 161 |
161 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) | 162 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
162 #include "chrome/browser/ui/sync/sync_promo_ui.h" | 163 #include "chrome/browser/ui/sync/sync_promo_ui.h" |
163 #include "chrome/browser/ui/webui/signin/inline_login_ui.h" | 164 #include "chrome/browser/ui/webui/signin/inline_login_ui.h" |
164 #include "chrome/browser/ui/webui/signin/md_user_manager_ui.h" | 165 #include "chrome/browser/ui/webui/signin/md_user_manager_ui.h" |
165 #include "chrome/browser/ui/webui/signin/signin_dice_internals_ui.h" | |
166 #include "chrome/browser/ui/webui/signin/signin_email_confirmation_ui.h" | 166 #include "chrome/browser/ui/webui/signin/signin_email_confirmation_ui.h" |
167 #include "chrome/browser/ui/webui/signin/signin_error_ui.h" | 167 #include "chrome/browser/ui/webui/signin/signin_error_ui.h" |
168 #include "chrome/browser/ui/webui/signin/sync_confirmation_ui.h" | 168 #include "chrome/browser/ui/webui/signin/sync_confirmation_ui.h" |
169 #include "chrome/browser/ui/webui/welcome_ui.h" | 169 #include "chrome/browser/ui/webui/welcome_ui.h" |
170 #endif | 170 #endif |
171 | 171 |
172 #if defined(OS_WIN) | 172 #if defined(OS_WIN) |
173 #include "chrome/browser/ui/webui/conflicts_ui.h" | 173 #include "chrome/browser/ui/webui/conflicts_ui.h" |
174 #include "chrome/browser/ui/webui/set_as_default_browser_ui_win.h" | 174 #include "chrome/browser/ui/webui/set_as_default_browser_ui_win.h" |
175 #include "chrome/browser/ui/webui/welcome_win10_ui.h" | 175 #include "chrome/browser/ui/webui/welcome_win10_ui.h" |
176 #endif | 176 #endif |
177 | 177 |
178 #if defined(OS_LINUX) || defined(OS_ANDROID) | 178 #if defined(OS_LINUX) || defined(OS_ANDROID) |
179 #include "chrome/browser/ui/webui/sandbox_internals_ui.h" | 179 #include "chrome/browser/ui/webui/sandbox_internals_ui.h" |
180 #endif | 180 #endif |
181 | 181 |
182 #if defined(USE_NSS_CERTS) && defined(USE_AURA) | 182 #if defined(USE_NSS_CERTS) && defined(USE_AURA) |
183 #include "chrome/browser/ui/webui/certificate_viewer_ui.h" | 183 #include "chrome/browser/ui/webui/certificate_viewer_ui.h" |
184 #endif | 184 #endif |
185 | 185 |
186 #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) | 186 #if BUILDFLAG(ENABLE_SERVICE_DISCOVERY) |
187 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui.h" | 187 #include "chrome/browser/ui/webui/local_discovery/local_discovery_ui.h" |
188 #endif | 188 #endif |
189 | 189 |
190 #if BUILDFLAG(ENABLE_APP_LIST) | 190 #if BUILDFLAG(ENABLE_APP_LIST) |
191 #include "chrome/browser/ui/webui/app_list/start_page_ui.h" | 191 #include "chrome/browser/ui/webui/app_list/start_page_ui.h" |
192 #endif | 192 #endif |
193 | 193 |
| 194 #if BUILDFLAG(ENABLE_DICE_SUPPORT) |
| 195 #include "chrome/browser/ui/webui/signin/signin_dice_internals_ui.h" |
| 196 #endif |
| 197 |
194 #if BUILDFLAG(ENABLE_EXTENSIONS) | 198 #if BUILDFLAG(ENABLE_EXTENSIONS) |
195 #include "chrome/browser/extensions/extension_web_ui.h" | 199 #include "chrome/browser/extensions/extension_web_ui.h" |
196 #include "chrome/browser/ui/webui/extensions/extensions_ui.h" | 200 #include "chrome/browser/ui/webui/extensions/extensions_ui.h" |
197 #include "chrome/common/extensions/extension_constants.h" | 201 #include "chrome/common/extensions/extension_constants.h" |
198 #include "extensions/browser/extension_registry.h" | 202 #include "extensions/browser/extension_registry.h" |
199 #include "extensions/browser/extension_system.h" | 203 #include "extensions/browser/extension_system.h" |
200 #include "extensions/common/constants.h" | 204 #include "extensions/common/constants.h" |
201 #include "extensions/common/extension.h" | 205 #include "extensions/common/extension.h" |
202 #include "extensions/common/feature_switch.h" | 206 #include "extensions/common/feature_switch.h" |
203 #include "extensions/common/manifest.h" | 207 #include "extensions/common/manifest.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 /**************************************************************************** | 394 /**************************************************************************** |
391 * OS Specific #defines | 395 * OS Specific #defines |
392 ***************************************************************************/ | 396 ***************************************************************************/ |
393 #if !defined(OS_ANDROID) | 397 #if !defined(OS_ANDROID) |
394 #if !defined(OS_CHROMEOS) | 398 #if !defined(OS_CHROMEOS) |
395 // AppLauncherPage is not needed on Android or ChromeOS. | 399 // AppLauncherPage is not needed on Android or ChromeOS. |
396 if (url.host_piece() == chrome::kChromeUIAppLauncherPageHost && profile && | 400 if (url.host_piece() == chrome::kChromeUIAppLauncherPageHost && profile && |
397 extensions::ExtensionSystem::Get(profile)->extension_service()) { | 401 extensions::ExtensionSystem::Get(profile)->extension_service()) { |
398 return &NewWebUI<AppLauncherPageUI>; | 402 return &NewWebUI<AppLauncherPageUI>; |
399 } | 403 } |
400 // Desktop Identity Consistency is only available on Windows, Linux and macOS. | |
401 if (url.host() == chrome::kChromeUISigninDiceInternalsHost && | |
402 !profile->IsOffTheRecord() && | |
403 switches::IsAccountConsistencyDiceEnabled()) { | |
404 return &NewWebUI<SigninDiceInternalsUI>; | |
405 } | |
406 #endif // defined(OS_CHROMEOS) | 404 #endif // defined(OS_CHROMEOS) |
407 | 405 |
408 // Bookmarks are part of NTP on Android. | 406 // Bookmarks are part of NTP on Android. |
409 if (url.host_piece() == chrome::kChromeUIBookmarksHost) { | 407 if (url.host_piece() == chrome::kChromeUIBookmarksHost) { |
410 return MdBookmarksUI::IsEnabled() ? &NewWebUI<MdBookmarksUI> | 408 return MdBookmarksUI::IsEnabled() ? &NewWebUI<MdBookmarksUI> |
411 : &NewWebUI<BookmarksUI>; | 409 : &NewWebUI<BookmarksUI>; |
412 } | 410 } |
413 // Downloads list on Android uses the built-in download manager. | 411 // Downloads list on Android uses the built-in download manager. |
414 if (url.host_piece() == chrome::kChromeUIDownloadsHost) | 412 if (url.host_piece() == chrome::kChromeUIDownloadsHost) |
415 return &NewWebUI<MdDownloadsUI>; | 413 return &NewWebUI<MdDownloadsUI>; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 return &NewWebUI<PolicyUI>; | 558 return &NewWebUI<PolicyUI>; |
561 if (url.host_piece() == chrome::kChromeUIMdPolicyHost && | 559 if (url.host_piece() == chrome::kChromeUIMdPolicyHost && |
562 switches::MdPolicyPageEnabled()) { | 560 switches::MdPolicyPageEnabled()) { |
563 return &NewWebUI<PolicyMaterialDesignUI>; | 561 return &NewWebUI<PolicyMaterialDesignUI>; |
564 } | 562 } |
565 | 563 |
566 #if BUILDFLAG(ENABLE_APP_LIST) | 564 #if BUILDFLAG(ENABLE_APP_LIST) |
567 if (url.host_piece() == chrome::kChromeUIAppListStartPageHost) | 565 if (url.host_piece() == chrome::kChromeUIAppListStartPageHost) |
568 return &NewWebUI<app_list::StartPageUI>; | 566 return &NewWebUI<app_list::StartPageUI>; |
569 #endif | 567 #endif |
| 568 #if BUILDFLAG(ENABLE_DICE_SUPPORT) |
| 569 if (url.host() == chrome::kChromeUISigninDiceInternalsHost && |
| 570 !profile->IsOffTheRecord() && |
| 571 switches::IsAccountConsistencyDiceEnabled()) { |
| 572 return &NewWebUI<SigninDiceInternalsUI>; |
| 573 } |
| 574 #endif |
570 #if BUILDFLAG(ENABLE_EXTENSIONS) | 575 #if BUILDFLAG(ENABLE_EXTENSIONS) |
571 if (url.host_piece() == chrome::kChromeUIExtensionsFrameHost) | 576 if (url.host_piece() == chrome::kChromeUIExtensionsFrameHost) |
572 return &NewWebUI<extensions::ExtensionsUI>; | 577 return &NewWebUI<extensions::ExtensionsUI>; |
573 #endif | 578 #endif |
574 #if BUILDFLAG(ENABLE_PLUGINS) | 579 #if BUILDFLAG(ENABLE_PLUGINS) |
575 if (url.host_piece() == chrome::kChromeUIFlashHost) | 580 if (url.host_piece() == chrome::kChromeUIFlashHost) |
576 return &NewWebUI<FlashUI>; | 581 return &NewWebUI<FlashUI>; |
577 #endif | 582 #endif |
578 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) | 583 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
579 if (url.host_piece() == chrome::kChromeUIPrintHost && | 584 if (url.host_piece() == chrome::kChromeUIPrintHost && |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
800 | 805 |
801 #if BUILDFLAG(ENABLE_EXTENSIONS) | 806 #if BUILDFLAG(ENABLE_EXTENSIONS) |
802 if (page_url.host_piece() == chrome::kChromeUIExtensionsHost || | 807 if (page_url.host_piece() == chrome::kChromeUIExtensionsHost || |
803 page_url.host_piece() == chrome::kChromeUIExtensionsFrameHost) | 808 page_url.host_piece() == chrome::kChromeUIExtensionsFrameHost) |
804 return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor); | 809 return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor); |
805 #endif // BUILDFLAG(ENABLE_EXTENSIONS) | 810 #endif // BUILDFLAG(ENABLE_EXTENSIONS) |
806 #endif // !defined(OS_ANDROID) | 811 #endif // !defined(OS_ANDROID) |
807 | 812 |
808 return NULL; | 813 return NULL; |
809 } | 814 } |
OLD | NEW |