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

Unified Diff: ios/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 | « ios/chrome/browser/ui/webui/BUILD.gn ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc
diff --git a/ios/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc b/ios/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc
index 467cbd9df387ef6105dd59fa6a2c622883ab4183..43f6165aa626ca8177b8a36c9225a55e2c3ab13c 100644
--- a/ios/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc
+++ b/ios/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc
@@ -6,12 +6,14 @@
#include "base/memory/ptr_util.h"
#include "components/grit/components_resources.h"
+#include "components/keyed_service/core/service_access_type.h"
#include "components/ntp_tiles/field_trial.h"
#include "components/ntp_tiles/most_visited_sites.h"
#include "components/ntp_tiles/webui/ntp_tiles_internals_message_handler.h"
#include "components/ntp_tiles/webui/ntp_tiles_internals_message_handler_client.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/chrome_url_constants.h"
+#include "ios/chrome/browser/favicon/favicon_service_factory.h"
#include "ios/chrome/browser/ntp_tiles/ios_most_visited_sites_factory.h"
#include "ios/chrome/browser/ntp_tiles/ios_popular_sites_factory.h"
#include "ios/web/public/web_thread.h"
@@ -26,7 +28,10 @@ class IOSNTPTilesInternalsMessageHandlerBridge
: public web::WebUIIOSMessageHandler,
public ntp_tiles::NTPTilesInternalsMessageHandlerClient {
public:
- IOSNTPTilesInternalsMessageHandlerBridge() {}
+ // |favicon_service| must not be null and must outlive this object.
+ explicit IOSNTPTilesInternalsMessageHandlerBridge(
+ favicon::FaviconService* favicon_service)
+ : handler_(favicon_service) {}
private:
// web::WebUIIOSMessageHandler:
@@ -109,10 +114,14 @@ web::WebUIIOSDataSource* CreateNTPTilesInternalsHTMLSource() {
NTPTilesInternalsUI::NTPTilesInternalsUI(web::WebUIIOS* web_ui)
: web::WebUIIOSController(web_ui) {
- web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui),
+ ios::ChromeBrowserState* browser_state =
+ ios::ChromeBrowserState::FromWebUIIOS(web_ui);
+ web::WebUIIOSDataSource::Add(browser_state,
CreateNTPTilesInternalsHTMLSource());
web_ui->AddMessageHandler(
- base::MakeUnique<IOSNTPTilesInternalsMessageHandlerBridge>());
+ base::MakeUnique<IOSNTPTilesInternalsMessageHandlerBridge>(
+ ios::FaviconServiceFactory::GetForBrowserState(
+ browser_state, ServiceAccessType::EXPLICIT_ACCESS)));
}
NTPTilesInternalsUI::~NTPTilesInternalsUI() {}
« no previous file with comments | « ios/chrome/browser/ui/webui/BUILD.gn ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698