Commit be16f5a1 authored by Kristi Park's avatar Kristi Park Committed by Commit Bot

[NTP] Indicate whether the tiles are custom links in chrome://ntp-tiles-internals

Fix chrome://ntp-tiles-internals so that the tile source will be shown
a CUSTOM_LINKS instead of WHITELIST. Also add a section to indicate that
the current tiles are custom links.

Screenshot: https://screenshot.googleplex.com/jXqpZMvJjgH.png

Change-Id: I41e3f5b5f4b0bf72ee8c75cee6e06b0193f78480
Reviewed-on: https://chromium-review.googlesource.com/c/1469068
Commit-Queue: Kristi Park <kristipark@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#632830}
parent 052d7748
...@@ -718,8 +718,6 @@ void MostVisitedSites::BuildCustomLinks( ...@@ -718,8 +718,6 @@ void MostVisitedSites::BuildCustomLinks(
tile.title = link.title; tile.title = link.title;
tile.url = link.url; tile.url = link.url;
tile.source = TileSource::CUSTOM_LINKS; tile.source = TileSource::CUSTOM_LINKS;
// TODO(crbug.com/773278): Populate |data_generation_time| here in order to
// log UMA metrics of age.
tiles.push_back(std::move(tile)); tiles.push_back(std::move(tile));
} }
......
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
namespace ntp_tiles { namespace ntp_tiles {
// The source of an NTP tile. // The source of an NTP tile. Please update webui/ntp-tiles-internals* as well
// when modifying these values.
// A Java counterpart will be generated for this enum. // A Java counterpart will be generated for this enum.
// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.suggestions // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.suggestions
enum class TileSource { enum class TileSource {
......
...@@ -100,6 +100,7 @@ void NTPTilesInternalsMessageHandler::HandleRegisterForEvents( ...@@ -100,6 +100,7 @@ void NTPTilesInternalsMessageHandler::HandleRegisterForEvents(
disabled.SetBoolean("topSites", false); disabled.SetBoolean("topSites", false);
disabled.SetBoolean("suggestionsService", false); disabled.SetBoolean("suggestionsService", false);
disabled.SetBoolean("popular", false); disabled.SetBoolean("popular", false);
disabled.SetBoolean("customLinks", false);
disabled.SetBoolean("whitelist", false); disabled.SetBoolean("whitelist", false);
client_->CallJavascriptFunction( client_->CallJavascriptFunction(
"chrome.ntp_tiles_internals.receiveSourceInfo", disabled); "chrome.ntp_tiles_internals.receiveSourceInfo", disabled);
...@@ -208,6 +209,8 @@ void NTPTilesInternalsMessageHandler::SendSourceInfo() { ...@@ -208,6 +209,8 @@ void NTPTilesInternalsMessageHandler::SendSourceInfo() {
value.SetBoolean("topSites", value.SetBoolean("topSites",
most_visited_sites_->DoesSourceExist(TileSource::TOP_SITES)); most_visited_sites_->DoesSourceExist(TileSource::TOP_SITES));
value.SetBoolean("customLinks", most_visited_sites_->DoesSourceExist(
TileSource::CUSTOM_LINKS));
value.SetBoolean("whitelist", value.SetBoolean("whitelist",
most_visited_sites_->DoesSourceExist(TileSource::WHITELIST)); most_visited_sites_->DoesSourceExist(TileSource::WHITELIST));
......
...@@ -86,6 +86,16 @@ found in the LICENSE file. ...@@ -86,6 +86,16 @@ found in the LICENSE file.
<td class="value">no</td> <td class="value">no</td>
</tr> </tr>
</tbody> </tbody>
<tbody jsselect="customLinks">
<tr>
<th colspan="2">CUSTOM_LINKS</th>
</tr>
<tr>
<td class="detail">enabled</td>
<td class="value" jsdisplay="$this">yes</td>
<td class="value" jsdisplay="!$this">no</td>
</tr>
</tbody>
<tbody jsselect="whitelist"> <tbody jsselect="whitelist">
<tr> <tr>
<th colspan="2">WHITELIST</th> <th colspan="2">WHITELIST</th>
...@@ -116,9 +126,10 @@ found in the LICENSE file. ...@@ -116,9 +126,10 @@ found in the LICENSE file.
<td class="value" jsdisplay="source == 1">SUGGESTIONS_SERVICE</td> <td class="value" jsdisplay="source == 1">SUGGESTIONS_SERVICE</td>
<td class="value" jsdisplay="source == 2">POPULAR</td> <td class="value" jsdisplay="source == 2">POPULAR</td>
<td class="value" jsdisplay="source == 3">POPULAR_BAKED_IN</td> <td class="value" jsdisplay="source == 3">POPULAR_BAKED_IN</td>
<td class="value" jsdisplay="source == 4">WHITELIST</td> <td class="value" jsdisplay="source == 4">CUSTOM_LINKS</td>
<td class="value" jsdisplay="source == 5">HOMEPAGE</td> <td class="value" jsdisplay="source == 5">WHITELIST</td>
<td class="value" jsdisplay="source &gt; 5">???</td> <td class="value" jsdisplay="source == 6">HOMEPAGE</td>
<td class="value" jsdisplay="source &gt; 6">???</td>
</tr> </tr>
<tr> <tr>
<td class="detail">URL</td> <td class="detail">URL</td>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment