Skip to content

Commit

Permalink
[Extensions] Fix //extensions deps in //chrome/browser/favicon
Browse files Browse the repository at this point in the history
Chrome code should rely on extensions targets only if extensions are
enabled (gn arg enable_extensions = true). Fix dependencies in
//chrome/browser/favicon to update the C++ and gn to put
extensions-related logic behind enable-extensions checks and update
dependencies accordingly.

Bug: 731689
Change-Id: Ie38ecbd1f360e2c55bd3992c1291e307676ba945
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3402442
Auto-Submit: Devlin Cronin <[email protected]>
Reviewed-by: Mikel Astiz <[email protected]>
Commit-Queue: Devlin Cronin <[email protected]>
Cr-Commit-Position: refs/heads/main@{#961719}
  • Loading branch information
rdcronin authored and Chromium LUCI CQ committed Jan 21, 2022
1 parent 87fd6cb commit bb9ac15
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions chrome/browser/favicon/chrome_favicon_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/dom_distiller/core/url_constants.h"
#include "components/dom_distiller/core/url_utils.h"
#include "extensions/common/constants.h"
#include "extensions/buildflags/buildflags.h"
#include "url/gurl.h"

#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "extensions/common/constants.h"
#endif

namespace {

void RunFaviconCallbackIfNotCanceled(
Expand All @@ -33,8 +37,12 @@ ChromeFaviconClient::~ChromeFaviconClient() {
}

bool ChromeFaviconClient::IsNativeApplicationURL(const GURL& url) {
return url.SchemeIs(content::kChromeUIScheme) ||
url.SchemeIs(extensions::kExtensionScheme);
#if BUILDFLAG(ENABLE_EXTENSIONS)
if (url.SchemeIs(extensions::kExtensionScheme))
return true;
#endif

return url.SchemeIs(content::kChromeUIScheme);
}

bool ChromeFaviconClient::IsReaderModeURL(const GURL& url) {
Expand Down

0 comments on commit bb9ac15

Please sign in to comment.