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

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 835903005: [Favicon] Add new fallback icon rendering flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding new host chrome://fallback-icon. Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/favicon/favicon_service.h » ('j') | chrome/browser/favicon/favicon_service.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index a93594708fc816d00a30ee1df19b28ffd2125a3f..fd23d1816061e89377336b24d0be8e069ca6b311 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -44,6 +44,7 @@
#include "chrome/browser/google/google_brand.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
+#include "chrome/browser/ui/webui/fallback_icon_source.h"
#include "chrome/browser/ui/webui/favicon_source.h"
#include "chrome/browser/ui/webui/ntp/thumbnail_source.h"
#include "chrome/browser/ui/webui/theme_source.h"
@@ -1065,6 +1066,15 @@ void ExtensionService::NotifyExtensionLoaded(const Extension* extension) {
const extensions::PermissionsData* permissions_data =
extension->permissions_data();
+ // If the extension has permission to load chrome://fallback-icon/ resources
+ // we need to make sure that the FallbackIconSource is registered with the
+ // ChromeURLDataManager.
+ if (permissions_data->HasHostPermission(
+ GURL(chrome::kChromeUIFallbackIconURL))) {
+ FallbackIconSource* fallback_icon_source = new FallbackIconSource();
+ content::URLDataSource::Add(profile_, fallback_icon_source);
+ }
pkotwicz 2015/01/21 19:44:14 Will there be any extensions with permission to lo
huangs 2015/01/22 01:13:27 Done.
+
// If the extension has permission to load chrome://favicon/ resources we need
// to make sure that the FaviconSource is registered with the
// ChromeURLDataManager.
« no previous file with comments | « no previous file | chrome/browser/favicon/favicon_service.h » ('j') | chrome/browser/favicon/favicon_service.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698