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

Unified Diff: components/ntp_tiles/webui/ntp_tiles_internals_message_handler.cc

Issue 2721603002: chrome://ntp-tiles-internals: hide when incognito (Closed)
Patch Set: Created 3 years, 10 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/resources/ntp_tiles_internals.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_tiles/webui/ntp_tiles_internals_message_handler.cc
diff --git a/components/ntp_tiles/webui/ntp_tiles_internals_message_handler.cc b/components/ntp_tiles/webui/ntp_tiles_internals_message_handler.cc
index 43a90e941ce644e86f96223319ec01f124e6f73c..e362f7775019234fa60767015c6ca2592788b55b 100644
--- a/components/ntp_tiles/webui/ntp_tiles_internals_message_handler.cc
+++ b/components/ntp_tiles/webui/ntp_tiles_internals_message_handler.cc
@@ -71,6 +71,14 @@ void NTPTilesInternalsMessageHandler::RegisterMessages(
void NTPTilesInternalsMessageHandler::HandleRegisterForEvents(
const base::ListValue* args) {
if (!client_->SupportsNTPTiles()) {
+ base::DictionaryValue disabled;
+ disabled.SetBoolean("topSites", false);
+ disabled.SetBoolean("suggestionsService", false);
+ disabled.SetBoolean("popular", false);
+ disabled.SetBoolean("whitelist", false);
+ client_->CallJavascriptFunction(
+ "chrome.ntp_tiles_internals.receiveSourceInfo", disabled);
+ SendTiles(NTPTilesVector());
return;
}
DCHECK(args->empty());
@@ -87,6 +95,7 @@ void NTPTilesInternalsMessageHandler::HandleUpdate(
if (!client_->SupportsNTPTiles()) {
return;
}
+
const base::DictionaryValue* dict = nullptr;
DCHECK_EQ(1u, args->GetSize());
args->GetDictionary(0, &dict);
« no previous file with comments | « no previous file | components/ntp_tiles/webui/resources/ntp_tiles_internals.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698