Skip to content

Commit

Permalink
Fix missing favicons in auto-contribute table on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
emerick committed Dec 20, 2019
1 parent 712ed54 commit 8a4577b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 5 deletions.
24 changes: 24 additions & 0 deletions browser/ui/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@ import("//build/config/features.gni")
import("//components/gcm_driver/config.gni")
import("//chrome/common/features.gni")

source_set("favicon_source") {
sources = [
"//chrome/browser/ui/webui/favicon_source.cc",
"//chrome/browser/ui/webui/favicon_source.h",
]

deps = [
"//components/favicon/core",
"//components/favicon_base",
"//components/history/core/browser",
"//net",
"//ui/native_theme",
"//url",
]
}

source_set("ui") {
sources = [
"webui/basic_ui.cc",
Expand Down Expand Up @@ -202,6 +218,14 @@ source_set("ui") {
"//ui/resources",
]

# This is no longer compiled into Chromium on Android, but we still
# need it
if (is_android) {
deps += [
":favicon_source",
]
}

if (enable_brave_sync) {
deps += [
"//brave/components/brave_sync",
Expand Down
9 changes: 4 additions & 5 deletions browser/ui/webui/brave_rewards_page_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -297,12 +297,11 @@ RewardsDOMHandler::~RewardsDOMHandler() {

void RewardsDOMHandler::RegisterMessages() {
#if defined(OS_ANDROID)
// TODO(sergz) figure out why we have link error here
// Create our favicon data source.
// Profile* profile = Profile::FromWebUI(web_ui());
// content::URLDataSource::Add(profile,
// std::make_unique<FaviconSource>(profile,
// chrome::FaviconUrlFormat::kFaviconLegacy));
Profile* profile = Profile::FromWebUI(web_ui());
content::URLDataSource::Add(
profile, std::make_unique<FaviconSource>(
profile, chrome::FaviconUrlFormat::kFaviconLegacy));
#endif

web_ui()->RegisterMessageCallback("brave_rewards.createWalletRequested",
Expand Down
15 changes: 15 additions & 0 deletions chromium_src/chrome/browser/ui/webui/favicon_source.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright (c) 2019 The Brave Authors
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// you can obtain one at http://mozilla.org/MPL/2.0/.

#include "build/build_config.h"

#if defined(OS_ANDROID)
#define IDR_DEFAULT_FAVICON_32 IDR_DEFAULT_FAVICON
#define IDR_DEFAULT_FAVICON_64 IDR_DEFAULT_FAVICON
#define IDR_DEFAULT_FAVICON_DARK_32 IDR_DEFAULT_FAVICON_DARK
#define IDR_DEFAULT_FAVICON_DARK_64 IDR_DEFAULT_FAVICON_DARK
#endif

#include "../../../../../chrome/browser/ui/webui/favicon_source.cc" // NOLINT

0 comments on commit 8a4577b

Please sign in to comment.