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

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

Issue 2584483002: Fix ntp-tiles-internals crash in incognito mode (Closed)
Patch Set: rebase Created 3 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 | « components/ntp_tiles/webui/ntp_tiles_internals_message_handler_client.h ('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 ecf53866297617e9a2d6c91c097f6ded63559e30..c36e931e5feb725364f69e8e4331433b69d618bc 100644
--- a/ios/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc
+++ b/ios/chrome/browser/ui/webui/ntp_tiles_internals_ui.cc
@@ -34,6 +34,7 @@ class IOSNTPTilesInternalsMessageHandlerBridge
void RegisterMessages() override;
// ntp_tiles::NTPTilesInternalsMessageHandlerClient
+ bool SupportsNTPTiles() override;
bool DoesSourceExist(ntp_tiles::NTPTileSource source) override;
std::unique_ptr<ntp_tiles::MostVisitedSites> MakeMostVisitedSites() override;
std::unique_ptr<ntp_tiles::PopularSites> MakePopularSites() override;
@@ -54,6 +55,11 @@ void IOSNTPTilesInternalsMessageHandlerBridge::RegisterMessages() {
handler_.RegisterMessages(this);
}
+bool IOSNTPTilesInternalsMessageHandlerBridge::SupportsNTPTiles() {
+ auto* state = ios::ChromeBrowserState::FromWebUIIOS(web_ui());
+ return !state->HasOffTheRecordChromeBrowserState();
+}
+
bool IOSNTPTilesInternalsMessageHandlerBridge::DoesSourceExist(
ntp_tiles::NTPTileSource source) {
switch (source) {
« no previous file with comments | « components/ntp_tiles/webui/ntp_tiles_internals_message_handler_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698