Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(522)

Side by Side Diff: chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc

Issue 2620153002: Fix front-end host creation upon navigation (Closed)
Patch Set: rebased on top of https://codereview.chromium.org/2607833002/ Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/devtools/url_constants.cc ('k') | chrome/browser/ui/webui/devtools_ui.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 if (url.host_piece() == chrome::kChromeUIPopularSitesInternalsHost) 519 if (url.host_piece() == chrome::kChromeUIPopularSitesInternalsHost)
519 return &NewWebUI<PopularSitesInternalsUI>; 520 return &NewWebUI<PopularSitesInternalsUI>;
520 if (url.host_piece() == chrome::kChromeUISnippetsInternalsHost && 521 if (url.host_piece() == chrome::kChromeUISnippetsInternalsHost &&
521 !profile->IsOffTheRecord()) 522 !profile->IsOffTheRecord())
522 return &NewWebUI<SnippetsInternalsUI>; 523 return &NewWebUI<SnippetsInternalsUI>;
523 #if defined(ENABLE_VR_SHELL) || defined(ENABLE_WEBVR) 524 #if defined(ENABLE_VR_SHELL) || defined(ENABLE_WEBVR)
524 if (url.host_piece() == chrome::kChromeUIVrShellUIHost) 525 if (url.host_piece() == chrome::kChromeUIVrShellUIHost)
525 return &NewWebUI<VrShellUIUI>; 526 return &NewWebUI<VrShellUIUI>;
526 #endif 527 #endif
527 #else 528 #else
528 if (url.SchemeIs(content::kChromeDevToolsScheme)) 529 if (url.SchemeIs(content::kChromeDevToolsScheme)) {
530 if (!DevToolsUIBindings::IsValidFrontendURL(url))
531 return nullptr;
529 return &NewWebUI<DevToolsUI>; 532 return &NewWebUI<DevToolsUI>;
530 533 }
531 // chrome://inspect isn't supported on Android nor iOS. Page debugging is 534 // chrome://inspect isn't supported on Android nor iOS. Page debugging is
532 // handled by a remote devtools on the host machine, and other elements, i.e. 535 // handled by a remote devtools on the host machine, and other elements, i.e.
533 // extensions aren't supported. 536 // extensions aren't supported.
534 if (url.host_piece() == chrome::kChromeUIInspectHost) 537 if (url.host_piece() == chrome::kChromeUIInspectHost)
535 return &NewWebUI<InspectUI>; 538 return &NewWebUI<InspectUI>;
536 #endif 539 #endif
537 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) 540 #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID)
538 if (url.host_piece() == chrome::kChromeUIChromeSigninHost) 541 if (url.host_piece() == chrome::kChromeUIChromeSigninHost)
539 return &NewWebUI<InlineLoginUI>; 542 return &NewWebUI<InlineLoginUI>;
540 if (url.host_piece() == chrome::kChromeUIMdUserManagerHost) 543 if (url.host_piece() == chrome::kChromeUIMdUserManagerHost)
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 #endif 824 #endif
822 825
823 // Android doesn't use the plugins pages. 826 // Android doesn't use the plugins pages.
824 if (page_url.host_piece() == chrome::kChromeUIPluginsHost) 827 if (page_url.host_piece() == chrome::kChromeUIPluginsHost)
825 return PluginsUI::GetFaviconResourceBytes(scale_factor); 828 return PluginsUI::GetFaviconResourceBytes(scale_factor);
826 829
827 #endif 830 #endif
828 831
829 return NULL; 832 return NULL;
830 } 833 }
OLDNEW
« no previous file with comments | « chrome/browser/devtools/url_constants.cc ('k') | chrome/browser/ui/webui/devtools_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698