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

Unified Diff: chrome/browser/ui/webui/ntp_tiles_internals_ui.cc

Issue 2936793002: ntp_tiles: Extend chrome://ntp-tiles-internals with favicon data (Closed)
Patch Set: Avoid using std::pair with constexpr. Created 3 years, 6 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 | components/ntp_tiles/webui/ntp_tiles_internals_message_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp_tiles_internals_ui.cc
diff --git a/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc b/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc
index 5f679da3960ef4a82921be1e358aa0b53759942f..c9e54c0d2c564dde10372269cc6366a616e30052 100644
--- a/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc
+++ b/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc
@@ -34,7 +34,10 @@ class ChromeNTPTilesInternalsMessageHandlerClient
: public content::WebUIMessageHandler,
public ntp_tiles::NTPTilesInternalsMessageHandlerClient {
public:
- ChromeNTPTilesInternalsMessageHandlerClient() {}
+ // |favicon_service| must not be null and must outlive this object.
+ explicit ChromeNTPTilesInternalsMessageHandlerClient(
+ favicon::FaviconService* favicon_service)
+ : handler_(favicon_service) {}
private:
// content::WebUIMessageHandler:
@@ -122,10 +125,12 @@ content::WebUIDataSource* CreateNTPTilesInternalsHTMLSource() {
NTPTilesInternalsUI::NTPTilesInternalsUI(content::WebUI* web_ui)
: WebUIController(web_ui) {
- content::WebUIDataSource::Add(Profile::FromWebUI(web_ui),
- CreateNTPTilesInternalsHTMLSource());
+ Profile* profile = Profile::FromWebUI(web_ui);
+ content::WebUIDataSource::Add(profile, CreateNTPTilesInternalsHTMLSource());
web_ui->AddMessageHandler(
- base::MakeUnique<ChromeNTPTilesInternalsMessageHandlerClient>());
+ base::MakeUnique<ChromeNTPTilesInternalsMessageHandlerClient>(
+ FaviconServiceFactory::GetForProfile(
+ profile, ServiceAccessType::EXPLICIT_ACCESS)));
}
NTPTilesInternalsUI::~NTPTilesInternalsUI() {}
« no previous file with comments | « no previous file | components/ntp_tiles/webui/ntp_tiles_internals_message_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698