| 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 #include "base/debug/stack_trace.h" |
| 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/location.h" | 12 #include "base/location.h" |
| 13 #include "base/threading/thread_task_runner_handle.h" | 13 #include "base/threading/thread_task_runner_handle.h" |
| 14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 if (url.host() == chrome::kChromeUIMdSettingsHost) | 427 if (url.host() == chrome::kChromeUIMdSettingsHost) |
| 428 return &NewWebUI<settings::MdSettingsUI>; | 428 return &NewWebUI<settings::MdSettingsUI>; |
| 429 // If the material design extensions page is enabled, it gets its own host. | 429 // If the material design extensions page is enabled, it gets its own host. |
| 430 // Otherwise, it's handled by the uber settings page. | 430 // Otherwise, it's handled by the uber settings page. |
| 431 if (url.host() == chrome::kChromeUIExtensionsHost && | 431 if (url.host() == chrome::kChromeUIExtensionsHost && |
| 432 base::FeatureList::IsEnabled(features::kMaterialDesignExtensions)) { | 432 base::FeatureList::IsEnabled(features::kMaterialDesignExtensions)) { |
| 433 return &NewWebUI<extensions::ExtensionsUI>; | 433 return &NewWebUI<extensions::ExtensionsUI>; |
| 434 } | 434 } |
| 435 // Material Design history is on its own host, rather than on an Uber page. | 435 // Material Design history is on its own host, rather than on an Uber page. |
| 436 if (MdHistoryUI::IsEnabled(profile) && | 436 if (MdHistoryUI::IsEnabled(profile) && |
| 437 url.host() == chrome::kChromeUIHistoryHost) { | 437 url.host() == chrome::kChromeUIUberHost && |
| 438 url.path().find("/" + std::string(chrome::kChromeUIHistoryHost)) == 0) { |
| 438 return &NewWebUI<MdHistoryUI>; | 439 return &NewWebUI<MdHistoryUI>; |
| 439 } | 440 } |
| 440 // Material Design Settings gets its own host, if enabled. | 441 // Material Design Settings gets its own host, if enabled. |
| 441 if (base::FeatureList::IsEnabled(features::kMaterialDesignSettings) && | 442 if (base::FeatureList::IsEnabled(features::kMaterialDesignSettings) && |
| 442 url.host() == chrome::kChromeUISettingsHost) { | 443 url.host() == chrome::kChromeUISettingsHost) { |
| 443 return &NewWebUI<settings::MdSettingsUI>; | 444 return &NewWebUI<settings::MdSettingsUI>; |
| 444 } | 445 } |
| 445 if (url.host() == chrome::kChromeUIQuotaInternalsHost) | 446 if (url.host() == chrome::kChromeUIQuotaInternalsHost) |
| 446 return &NewWebUI<QuotaInternalsUI>; | 447 return &NewWebUI<QuotaInternalsUI>; |
| 447 // Settings are implemented with native UI elements on Android. | 448 // Settings are implemented with native UI elements on Android. |
| 448 // Handle chrome://settings if settings in a window and about in settings | 449 // Handle chrome://settings if settings in a window and about in settings |
| 449 // are enabled. | 450 // are enabled. |
| 450 if (url.host() == chrome::kChromeUISettingsFrameHost || | 451 if (url.host() == chrome::kChromeUISettingsFrameHost || |
| 451 (url.host() == chrome::kChromeUISettingsHost && | 452 (url.host() == chrome::kChromeUISettingsHost && |
| 452 ::switches::AboutInSettingsEnabled())) { | 453 ::switches::AboutInSettingsEnabled())) { |
| 453 return &NewWebUI<options::OptionsUI>; | 454 return &NewWebUI<options::OptionsUI>; |
| 454 } | 455 } |
| 455 if (url.host() == chrome::kChromeUISyncFileSystemInternalsHost) | 456 if (url.host() == chrome::kChromeUISyncFileSystemInternalsHost) |
| 456 return &NewWebUI<SyncFileSystemInternalsUI>; | 457 return &NewWebUI<SyncFileSystemInternalsUI>; |
| 457 if (url.host() == chrome::kChromeUISystemInfoHost) | 458 if (url.host() == chrome::kChromeUISystemInfoHost) |
| 458 return &NewWebUI<SystemInfoUI>; | 459 return &NewWebUI<SystemInfoUI>; |
| 459 // Uber frame is not used on Android. | 460 // Uber frame is not used on Android. |
| 460 if (url.host() == chrome::kChromeUIUberFrameHost) | 461 if (url.host() == chrome::kChromeUIUberFrameHost) |
| 461 return &NewWebUI<UberFrameUI>; | 462 return &NewWebUI<UberFrameUI>; |
| 462 // Uber page is not used on Android. | 463 // Uber page is not used on Android. |
| 463 if (url.host() == chrome::kChromeUIUberHost) | 464 if (url.host() == chrome::kChromeUIUberHost) { |
| 464 return &NewWebUI<UberUI>; | 465 return &NewWebUI<UberUI>; |
| 466 } |
| 465 #endif // !defined(OS_ANDROID) | 467 #endif // !defined(OS_ANDROID) |
| 466 #if defined(OS_WIN) | 468 #if defined(OS_WIN) |
| 467 if (url.host() == chrome::kChromeUIConflictsHost) | 469 if (url.host() == chrome::kChromeUIConflictsHost) |
| 468 return &NewWebUI<ConflictsUI>; | 470 return &NewWebUI<ConflictsUI>; |
| 469 if (url.host() == chrome::kChromeUIMetroFlowHost) | 471 if (url.host() == chrome::kChromeUIMetroFlowHost) |
| 470 return &NewWebUI<SetAsDefaultBrowserUI>; | 472 return &NewWebUI<SetAsDefaultBrowserUI>; |
| 471 #endif | 473 #endif |
| 472 #if defined(OS_CHROMEOS) | 474 #if defined(OS_CHROMEOS) |
| 473 if (url.host() == chrome::kChromeUIBluetoothPairingHost) | 475 if (url.host() == chrome::kChromeUIBluetoothPairingHost) |
| 474 return &NewWebUI<chromeos::BluetoothPairingUI>; | 476 return &NewWebUI<chromeos::BluetoothPairingUI>; |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 #endif | 821 #endif |
| 820 | 822 |
| 821 // Android doesn't use the plugins pages. | 823 // Android doesn't use the plugins pages. |
| 822 if (page_url.host() == chrome::kChromeUIPluginsHost) | 824 if (page_url.host() == chrome::kChromeUIPluginsHost) |
| 823 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 825 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
| 824 | 826 |
| 825 #endif | 827 #endif |
| 826 | 828 |
| 827 return NULL; | 829 return NULL; |
| 828 } | 830 } |
| OLD | NEW |