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

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

Issue 2450623002: [MD Bookmarks] Add skeleton for Material Design Bookmarks (Closed)
Patch Set: address comments Created 4 years, 1 month 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
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
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 ||
797 page_url.host() == chrome::kChromeUIBookmarksHost) {
794 return BookmarksUI::GetFaviconResourceBytes(scale_factor); 798 return BookmarksUI::GetFaviconResourceBytes(scale_factor);
799 }
795 800
796 // The extension scheme is handled in GetFaviconForURL. 801 // The extension scheme is handled in GetFaviconForURL.
797 if (page_url.SchemeIs(extensions::kExtensionScheme)) { 802 if (page_url.SchemeIs(extensions::kExtensionScheme)) {
798 NOTREACHED(); 803 NOTREACHED();
799 return NULL; 804 return NULL;
800 } 805 }
801 #endif 806 #endif
802 807
803 if (!content::HasWebUIScheme(page_url)) 808 if (!content::HasWebUIScheme(page_url))
804 return NULL; 809 return NULL;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 #endif 853 #endif
849 854
850 // Android doesn't use the plugins pages. 855 // Android doesn't use the plugins pages.
851 if (page_url.host() == chrome::kChromeUIPluginsHost) 856 if (page_url.host() == chrome::kChromeUIPluginsHost)
852 return PluginsUI::GetFaviconResourceBytes(scale_factor); 857 return PluginsUI::GetFaviconResourceBytes(scale_factor);
853 858
854 #endif 859 #endif
855 860
856 return NULL; 861 return NULL;
857 } 862 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698