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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 #include "chrome/browser/ui/webui/popular_sites_internals_ui.h" | 111 #include "chrome/browser/ui/webui/popular_sites_internals_ui.h" |
112 #include "chrome/browser/ui/webui/snippets_internals_ui.h" | 112 #include "chrome/browser/ui/webui/snippets_internals_ui.h" |
113 #if defined(ENABLE_VR_SHELL) || defined(ENABLE_WEBVR) | 113 #if defined(ENABLE_VR_SHELL) || defined(ENABLE_WEBVR) |
114 #include "chrome/browser/ui/webui/vr_shell/vr_shell_ui_ui.h" | 114 #include "chrome/browser/ui/webui/vr_shell/vr_shell_ui_ui.h" |
115 #endif | 115 #endif |
116 #else | 116 #else |
117 #include "chrome/browser/signin/easy_unlock_service.h" | 117 #include "chrome/browser/signin/easy_unlock_service.h" |
118 #include "chrome/browser/signin/easy_unlock_service_factory.h" | 118 #include "chrome/browser/signin/easy_unlock_service_factory.h" |
119 #include "chrome/browser/ui/webui/devtools_ui.h" | 119 #include "chrome/browser/ui/webui/devtools_ui.h" |
120 #include "chrome/browser/ui/webui/inspect_ui.h" | 120 #include "chrome/browser/ui/webui/inspect_ui.h" |
121 #include "chrome/browser/ui/webui/md_bookmarks_ui.h" | |
121 #include "chrome/browser/ui/webui/md_downloads/md_downloads_ui.h" | 122 #include "chrome/browser/ui/webui/md_downloads/md_downloads_ui.h" |
122 #include "chrome/browser/ui/webui/md_feedback/md_feedback_ui.h" | 123 #include "chrome/browser/ui/webui/md_feedback/md_feedback_ui.h" |
123 #include "chrome/browser/ui/webui/md_history_ui.h" | 124 #include "chrome/browser/ui/webui/md_history_ui.h" |
124 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" | 125 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
125 #include "chrome/browser/ui/webui/quota_internals/quota_internals_ui.h" | 126 #include "chrome/browser/ui/webui/quota_internals/quota_internals_ui.h" |
126 #include "chrome/browser/ui/webui/sync_file_system_internals/sync_file_system_in ternals_ui.h" | 127 #include "chrome/browser/ui/webui/sync_file_system_internals/sync_file_system_in ternals_ui.h" |
127 #include "chrome/browser/ui/webui/system_info_ui.h" | 128 #include "chrome/browser/ui/webui/system_info_ui.h" |
128 #include "chrome/browser/ui/webui/uber/uber_ui.h" | 129 #include "chrome/browser/ui/webui/uber/uber_ui.h" |
129 #endif | 130 #endif |
130 | 131 |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
417 #if !defined(OS_CHROMEOS) | 418 #if !defined(OS_CHROMEOS) |
418 // AppLauncherPage is not needed on Android or ChromeOS. | 419 // AppLauncherPage is not needed on Android or ChromeOS. |
419 if (url.host() == chrome::kChromeUIAppLauncherPageHost && | 420 if (url.host() == chrome::kChromeUIAppLauncherPageHost && |
420 profile && extensions::ExtensionSystem::Get(profile)-> | 421 profile && extensions::ExtensionSystem::Get(profile)-> |
421 extension_service()) { | 422 extension_service()) { |
422 return &NewWebUI<AppLauncherPageUI>; | 423 return &NewWebUI<AppLauncherPageUI>; |
423 } | 424 } |
424 #endif // !defined(OS_CHROMEOS) | 425 #endif // !defined(OS_CHROMEOS) |
425 | 426 |
426 // Bookmarks are part of NTP on Android. | 427 // Bookmarks are part of NTP on Android. |
427 if (url.host() == chrome::kChromeUIBookmarksHost) | 428 if (url.host() == chrome::kChromeUIBookmarksHost) { |
428 return &NewWebUI<BookmarksUI>; | 429 return MdBookmarksUI::IsEnabled() ? &NewWebUI<MdBookmarksUI> |
430 : &NewWebUI<BookmarksUI>; | |
431 } | |
429 // Downloads list on Android uses the built-in download manager. | 432 // Downloads list on Android uses the built-in download manager. |
430 if (url.host() == chrome::kChromeUIDownloadsHost) | 433 if (url.host() == chrome::kChromeUIDownloadsHost) |
431 return &NewWebUI<MdDownloadsUI>; | 434 return &NewWebUI<MdDownloadsUI>; |
432 // Material Design feedback. Feedback is implemented separately in | 435 // Material Design feedback. Feedback is implemented separately in |
433 // Android. | 436 // Android. |
434 if (url.host() == chrome::kChromeUIFeedbackHost && | 437 if (url.host() == chrome::kChromeUIFeedbackHost && |
435 ::switches::MdFeedbackEnabled()) { | 438 ::switches::MdFeedbackEnabled()) { |
436 return &NewWebUI<MdFeedbackUI>; | 439 return &NewWebUI<MdFeedbackUI>; |
437 } | 440 } |
438 // Help is implemented with native UI elements on Android. | 441 // Help is implemented with native UI elements on Android. |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
783 } | 786 } |
784 | 787 |
785 ChromeWebUIControllerFactory::~ChromeWebUIControllerFactory() { | 788 ChromeWebUIControllerFactory::~ChromeWebUIControllerFactory() { |
786 } | 789 } |
787 | 790 |
788 base::RefCountedMemory* ChromeWebUIControllerFactory::GetFaviconResourceBytes( | 791 base::RefCountedMemory* ChromeWebUIControllerFactory::GetFaviconResourceBytes( |
789 const GURL& page_url, ui::ScaleFactor scale_factor) const { | 792 const GURL& page_url, ui::ScaleFactor scale_factor) const { |
790 #if !defined(OS_ANDROID) // Bookmarks are part of NTP on Android. | 793 #if !defined(OS_ANDROID) // Bookmarks are part of NTP on Android. |
791 // The bookmark manager is a chrome extension, so we have to check for it | 794 // The bookmark manager is a chrome extension, so we have to check for it |
792 // before we check for extension scheme. | 795 // before we check for extension scheme. |
793 if (page_url.host() == extension_misc::kBookmarkManagerId) | 796 if (page_url.host() == extension_misc::kBookmarkManagerId) { |
794 return BookmarksUI::GetFaviconResourceBytes(scale_factor); | 797 return BookmarksUI::GetFaviconResourceBytes(scale_factor); |
798 } | |
799 | |
800 if (page_url.host() == chrome::kChromeUIBookmarksHost) { | |
801 return MdBookmarksUI::GetFaviconResourceBytes(scale_factor); | |
Dan Beam
2016/10/29 01:10:00
why do we want these favicons to ever be different
calamity
2016/11/01 02:37:59
Removed.
| |
802 } | |
Dan Beam
2016/10/29 01:10:00
nit: no curlies on 1-liners
calamity
2016/11/01 02:37:59
N/A.
| |
795 | 803 |
796 // The extension scheme is handled in GetFaviconForURL. | 804 // The extension scheme is handled in GetFaviconForURL. |
797 if (page_url.SchemeIs(extensions::kExtensionScheme)) { | 805 if (page_url.SchemeIs(extensions::kExtensionScheme)) { |
798 NOTREACHED(); | 806 NOTREACHED(); |
799 return NULL; | 807 return NULL; |
800 } | 808 } |
801 #endif | 809 #endif |
802 | 810 |
803 if (!content::HasWebUIScheme(page_url)) | 811 if (!content::HasWebUIScheme(page_url)) |
804 return NULL; | 812 return NULL; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
848 #endif | 856 #endif |
849 | 857 |
850 // Android doesn't use the plugins pages. | 858 // Android doesn't use the plugins pages. |
851 if (page_url.host() == chrome::kChromeUIPluginsHost) | 859 if (page_url.host() == chrome::kChromeUIPluginsHost) |
852 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 860 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
853 | 861 |
854 #endif | 862 #endif |
855 | 863 |
856 return NULL; | 864 return NULL; |
857 } | 865 } |
OLD | NEW |