| 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/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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 #if !defined(OS_CHROMEOS) | 401 #if !defined(OS_CHROMEOS) |
| 401 // AppLauncherPage is not needed on Android or ChromeOS. | 402 // AppLauncherPage is not needed on Android or ChromeOS. |
| 402 if (url.host() == chrome::kChromeUIAppLauncherPageHost && | 403 if (url.host() == chrome::kChromeUIAppLauncherPageHost && |
| 403 profile && extensions::ExtensionSystem::Get(profile)-> | 404 profile && extensions::ExtensionSystem::Get(profile)-> |
| 404 extension_service()) { | 405 extension_service()) { |
| 405 return &NewWebUI<AppLauncherPageUI>; | 406 return &NewWebUI<AppLauncherPageUI>; |
| 406 } | 407 } |
| 407 #endif // !defined(OS_CHROMEOS) | 408 #endif // !defined(OS_CHROMEOS) |
| 408 | 409 |
| 409 // Bookmarks are part of NTP on Android. | 410 // Bookmarks are part of NTP on Android. |
| 410 if (url.host() == chrome::kChromeUIBookmarksHost) | 411 if (url.host() == chrome::kChromeUIBookmarksHost) { |
| 411 return &NewWebUI<BookmarksUI>; | 412 return MdBookmarksUI::IsEnabled() ? &NewWebUI<MdBookmarksUI> |
| 413 : &NewWebUI<BookmarksUI>; |
| 414 } |
| 412 // Downloads list on Android uses the built-in download manager. | 415 // Downloads list on Android uses the built-in download manager. |
| 413 if (url.host() == chrome::kChromeUIDownloadsHost) | 416 if (url.host() == chrome::kChromeUIDownloadsHost) |
| 414 return &NewWebUI<MdDownloadsUI>; | 417 return &NewWebUI<MdDownloadsUI>; |
| 415 // Material Design feedback. Feedback is implemented separately in | 418 // Material Design feedback. Feedback is implemented separately in |
| 416 // Android. | 419 // Android. |
| 417 if (url.host() == chrome::kChromeUIFeedbackHost && | 420 if (url.host() == chrome::kChromeUIFeedbackHost && |
| 418 ::switches::MdFeedbackEnabled()) { | 421 ::switches::MdFeedbackEnabled()) { |
| 419 return &NewWebUI<MdFeedbackUI>; | 422 return &NewWebUI<MdFeedbackUI>; |
| 420 } | 423 } |
| 421 // Help is implemented with native UI elements on Android. | 424 // Help is implemented with native UI elements on Android. |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 766 } | 769 } |
| 767 | 770 |
| 768 ChromeWebUIControllerFactory::~ChromeWebUIControllerFactory() { | 771 ChromeWebUIControllerFactory::~ChromeWebUIControllerFactory() { |
| 769 } | 772 } |
| 770 | 773 |
| 771 base::RefCountedMemory* ChromeWebUIControllerFactory::GetFaviconResourceBytes( | 774 base::RefCountedMemory* ChromeWebUIControllerFactory::GetFaviconResourceBytes( |
| 772 const GURL& page_url, ui::ScaleFactor scale_factor) const { | 775 const GURL& page_url, ui::ScaleFactor scale_factor) const { |
| 773 #if !defined(OS_ANDROID) // Bookmarks are part of NTP on Android. | 776 #if !defined(OS_ANDROID) // Bookmarks are part of NTP on Android. |
| 774 // The bookmark manager is a chrome extension, so we have to check for it | 777 // The bookmark manager is a chrome extension, so we have to check for it |
| 775 // before we check for extension scheme. | 778 // before we check for extension scheme. |
| 776 if (page_url.host() == extension_misc::kBookmarkManagerId) | 779 if (page_url.host() == extension_misc::kBookmarkManagerId || |
| 780 page_url.host() == chrome::kChromeUIBookmarksHost) { |
| 777 return BookmarksUI::GetFaviconResourceBytes(scale_factor); | 781 return BookmarksUI::GetFaviconResourceBytes(scale_factor); |
| 782 } |
| 778 | 783 |
| 779 // The extension scheme is handled in GetFaviconForURL. | 784 // The extension scheme is handled in GetFaviconForURL. |
| 780 if (page_url.SchemeIs(extensions::kExtensionScheme)) { | 785 if (page_url.SchemeIs(extensions::kExtensionScheme)) { |
| 781 NOTREACHED(); | 786 NOTREACHED(); |
| 782 return NULL; | 787 return NULL; |
| 783 } | 788 } |
| 784 #endif | 789 #endif |
| 785 | 790 |
| 786 if (!content::HasWebUIScheme(page_url)) | 791 if (!content::HasWebUIScheme(page_url)) |
| 787 return NULL; | 792 return NULL; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 #endif | 836 #endif |
| 832 | 837 |
| 833 // Android doesn't use the plugins pages. | 838 // Android doesn't use the plugins pages. |
| 834 if (page_url.host() == chrome::kChromeUIPluginsHost) | 839 if (page_url.host() == chrome::kChromeUIPluginsHost) |
| 835 return PluginsUI::GetFaviconResourceBytes(scale_factor); | 840 return PluginsUI::GetFaviconResourceBytes(scale_factor); |
| 836 | 841 |
| 837 #endif | 842 #endif |
| 838 | 843 |
| 839 return NULL; | 844 return NULL; |
| 840 } | 845 } |
| OLD | NEW |