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 |
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" |
15 #include "chrome/browser/about_flags.h" | 15 #include "chrome/browser/about_flags.h" |
| 16 #include "chrome/browser/devtools/devtools_ui_bindings.h" |
16 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" | 17 #include "chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
17 #include "chrome/browser/engagement/site_engagement_service.h" | 18 #include "chrome/browser/engagement/site_engagement_service.h" |
18 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
19 #include "chrome/browser/profiles/profile_manager.h" | 20 #include "chrome/browser/profiles/profile_manager.h" |
20 #include "chrome/browser/search/suggestions/suggestions_ui.h" | 21 #include "chrome/browser/search/suggestions/suggestions_ui.h" |
21 #include "chrome/browser/ui/webui/about_ui.h" | 22 #include "chrome/browser/ui/webui/about_ui.h" |
22 #include "chrome/browser/ui/webui/bluetooth_internals/bluetooth_internals_ui.h" | 23 #include "chrome/browser/ui/webui/bluetooth_internals/bluetooth_internals_ui.h" |
23 #include "chrome/browser/ui/webui/bookmarks_ui.h" | 24 #include "chrome/browser/ui/webui/bookmarks_ui.h" |
24 #include "chrome/browser/ui/webui/components_ui.h" | 25 #include "chrome/browser/ui/webui/components_ui.h" |
25 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" | 26 #include "chrome/browser/ui/webui/constrained_web_dialog_ui.h" |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 if (url.host_piece() == chrome::kChromeUIPopularSitesInternalsHost) | 511 if (url.host_piece() == chrome::kChromeUIPopularSitesInternalsHost) |
511 return &NewWebUI<PopularSitesInternalsUI>; | 512 return &NewWebUI<PopularSitesInternalsUI>; |
512 if (url.host_piece() == chrome::kChromeUISnippetsInternalsHost && | 513 if (url.host_piece() == chrome::kChromeUISnippetsInternalsHost && |
513 !profile->IsOffTheRecord()) | 514 !profile->IsOffTheRecord()) |
514 return &NewWebUI<SnippetsInternalsUI>; | 515 return &NewWebUI<SnippetsInternalsUI>; |
515 #if defined(ENABLE_VR_SHELL) || defined(ENABLE_WEBVR) | 516 #if defined(ENABLE_VR_SHELL) || defined(ENABLE_WEBVR) |
516 if (url.host_piece() == chrome::kChromeUIVrShellUIHost) | 517 if (url.host_piece() == chrome::kChromeUIVrShellUIHost) |
517 return &NewWebUI<VrShellUIUI>; | 518 return &NewWebUI<VrShellUIUI>; |
518 #endif | 519 #endif |
519 #else | 520 #else |
520 if (url.SchemeIs(content::kChromeDevToolsScheme)) | 521 if (url.SchemeIs(content::kChromeDevToolsScheme)) { |
| 522 if (!DevToolsUIBindings::IsValidFrontendURL(url)) |
| 523 return nullptr; |
521 return &NewWebUI<DevToolsUI>; | 524 return &NewWebUI<DevToolsUI>; |
522 | 525 } |
523 // chrome://inspect isn't supported on Android nor iOS. Page debugging is | 526 // chrome://inspect isn't supported on Android nor iOS. Page debugging is |
524 // handled by a remote devtools on the host machine, and other elements, i.e. | 527 // handled by a remote devtools on the host machine, and other elements, i.e. |
525 // extensions aren't supported. | 528 // extensions aren't supported. |
526 if (url.host_piece() == chrome::kChromeUIInspectHost) | 529 if (url.host_piece() == chrome::kChromeUIInspectHost) |
527 return &NewWebUI<InspectUI>; | 530 return &NewWebUI<InspectUI>; |
528 #endif | 531 #endif |
529 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) | 532 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
530 if (url.host_piece() == chrome::kChromeUIChromeSigninHost) | 533 if (url.host_piece() == chrome::kChromeUIChromeSigninHost) |
531 return &NewWebUI<InlineLoginUI>; | 534 return &NewWebUI<InlineLoginUI>; |
532 if (url.host_piece() == chrome::kChromeUIMdUserManagerHost) | 535 if (url.host_piece() == chrome::kChromeUIMdUserManagerHost) |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 #endif | 816 #endif |
814 | 817 |
815 // Android doesn't use the plugins pages. | 818 // Android doesn't use the plugins pages. |
816 if (page_url.host_piece() == chrome::kChromeUIPluginsHost) | 819 if (page_url.host_piece() == chrome::kChromeUIPluginsHost) |
817 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 820 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
818 | 821 |
819 #endif | 822 #endif |
820 | 823 |
821 return NULL; | 824 return NULL; |
822 } | 825 } |
OLD | NEW |