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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 return &NewWebUI<MdFeedbackUI>; | 416 return &NewWebUI<MdFeedbackUI>; |
417 } | 417 } |
418 // Help is implemented with native UI elements on Android. | 418 // Help is implemented with native UI elements on Android. |
419 if (url.host_piece() == chrome::kChromeUIHelpFrameHost) | 419 if (url.host_piece() == chrome::kChromeUIHelpFrameHost) |
420 return &NewWebUI<HelpUI>; | 420 return &NewWebUI<HelpUI>; |
421 // Identity API is not available on Android. | 421 // Identity API is not available on Android. |
422 if (url.host_piece() == chrome::kChromeUIIdentityInternalsHost) | 422 if (url.host_piece() == chrome::kChromeUIIdentityInternalsHost) |
423 return &NewWebUI<IdentityInternalsUI>; | 423 return &NewWebUI<IdentityInternalsUI>; |
424 if (url.host_piece() == chrome::kChromeUINewTabHost) | 424 if (url.host_piece() == chrome::kChromeUINewTabHost) |
425 return &NewWebUI<NewTabUI>; | 425 return &NewWebUI<NewTabUI>; |
426 if (url.host_piece() == chrome::kChromeUIMdSettingsHost) | 426 // Settings are implemented with native UI elements on Android. |
| 427 if (url.host_piece() == chrome::kChromeUISettingsHost || |
| 428 url.host_piece() == chrome::kChromeUIMdSettingsHost) { |
427 return &NewWebUI<settings::MdSettingsUI>; | 429 return &NewWebUI<settings::MdSettingsUI>; |
| 430 } |
| 431 if (url.host_piece() == chrome::kChromeUISettingsFrameHost) |
| 432 return &NewWebUI<options::OptionsUI>; |
428 // 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. |
429 // Otherwise, it's handled by the uber settings page. | 434 // Otherwise, it's handled by the uber settings page. |
430 if (url.host_piece() == chrome::kChromeUIExtensionsHost && | 435 if (url.host_piece() == chrome::kChromeUIExtensionsHost && |
431 base::FeatureList::IsEnabled(features::kMaterialDesignExtensions)) { | 436 base::FeatureList::IsEnabled(features::kMaterialDesignExtensions)) { |
432 return &NewWebUI<extensions::ExtensionsUI>; | 437 return &NewWebUI<extensions::ExtensionsUI>; |
433 } | 438 } |
434 if (url.host_piece() == chrome::kChromeUIHistoryHost) | 439 if (url.host_piece() == chrome::kChromeUIHistoryHost) |
435 return &NewWebUI<MdHistoryUI>; | 440 return &NewWebUI<MdHistoryUI>; |
436 // Material Design Settings gets its own host, if enabled. | |
437 if (base::FeatureList::IsEnabled(features::kMaterialDesignSettings) && | |
438 url.host_piece() == chrome::kChromeUISettingsHost) { | |
439 return &NewWebUI<settings::MdSettingsUI>; | |
440 } | |
441 // Settings are implemented with native UI elements on Android. | |
442 // Handle chrome://settings if settings in a window is enabled. | |
443 if (url.host_piece() == chrome::kChromeUISettingsFrameHost || | |
444 (url.host_piece() == chrome::kChromeUISettingsHost && | |
445 ::switches::SettingsWindowEnabled())) { | |
446 return &NewWebUI<options::OptionsUI>; | |
447 } | |
448 if (url.host_piece() == chrome::kChromeUISyncFileSystemInternalsHost) | 441 if (url.host_piece() == chrome::kChromeUISyncFileSystemInternalsHost) |
449 return &NewWebUI<SyncFileSystemInternalsUI>; | 442 return &NewWebUI<SyncFileSystemInternalsUI>; |
450 if (url.host_piece() == chrome::kChromeUISystemInfoHost) | 443 if (url.host_piece() == chrome::kChromeUISystemInfoHost) |
451 return &NewWebUI<SystemInfoUI>; | 444 return &NewWebUI<SystemInfoUI>; |
452 // Uber frame is not used on Android. | 445 // Uber frame is not used on Android. |
453 if (url.host_piece() == chrome::kChromeUIUberFrameHost) | 446 if (url.host_piece() == chrome::kChromeUIUberFrameHost) |
454 return &NewWebUI<UberFrameUI>; | 447 return &NewWebUI<UberFrameUI>; |
455 // Uber page is not used on Android. | 448 // Uber page is not used on Android. |
456 if (url.host_piece() == chrome::kChromeUIUberHost) | 449 if (url.host_piece() == chrome::kChromeUIUberHost) |
457 return &NewWebUI<UberUI>; | 450 return &NewWebUI<UberUI>; |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 | 812 |
820 #if BUILDFLAG(ENABLE_EXTENSIONS) | 813 #if BUILDFLAG(ENABLE_EXTENSIONS) |
821 if (page_url.host_piece() == chrome::kChromeUIExtensionsHost || | 814 if (page_url.host_piece() == chrome::kChromeUIExtensionsHost || |
822 page_url.host_piece() == chrome::kChromeUIExtensionsFrameHost) | 815 page_url.host_piece() == chrome::kChromeUIExtensionsFrameHost) |
823 return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor); | 816 return extensions::ExtensionsUI::GetFaviconResourceBytes(scale_factor); |
824 #endif // BUILDFLAG(ENABLE_EXTENSIONS) | 817 #endif // BUILDFLAG(ENABLE_EXTENSIONS) |
825 #endif // !defined(OS_ANDROID) | 818 #endif // !defined(OS_ANDROID) |
826 | 819 |
827 return NULL; | 820 return NULL; |
828 } | 821 } |
OLD | NEW |