|
@@ -1,116 +0,0 @@
|
|
|
-From: csagan5 <32685696+csagan5@users.noreply.github.com>
|
|
|
-Date: Mon, 9 Jul 2018 20:12:19 +0200
|
|
|
-Subject: Add flag to show/hide NTP tiles
|
|
|
-
|
|
|
----
|
|
|
- chrome/browser/about_flags.cc | 4 ++++
|
|
|
- chrome/browser/android/ntp/most_visited_sites_bridge.cc | 8 ++++++++
|
|
|
- chrome/browser/flag_descriptions.cc | 4 ++++
|
|
|
- chrome/browser/flag_descriptions.h | 3 +++
|
|
|
- chrome/common/chrome_switches.cc | 3 +++
|
|
|
- chrome/common/chrome_switches.h | 1 +
|
|
|
- 6 files changed, 23 insertions(+)
|
|
|
-
|
|
|
-diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
|
|
|
---- a/chrome/browser/about_flags.cc
|
|
|
-+++ b/chrome/browser/about_flags.cc
|
|
|
-@@ -1866,6 +1866,10 @@ const FeatureEntry kFeatureEntries[] = {
|
|
|
- SINGLE_VALUE_TYPE(switches::kHostedAppQuitNotification)},
|
|
|
- #endif // OS_MACOSX
|
|
|
- #if defined(OS_ANDROID)
|
|
|
-+ {"hide-ntp-tiles",
|
|
|
-+ flag_descriptions::kHideNTPTilesName,
|
|
|
-+ flag_descriptions::kHideNTPTilesDescription, kOsAndroid,
|
|
|
-+ SINGLE_VALUE_TYPE(switches::kHideNTPTiles)},
|
|
|
- {"disable-pull-to-refresh-effect",
|
|
|
- flag_descriptions::kPullToRefreshEffectName,
|
|
|
- flag_descriptions::kPullToRefreshEffectDescription, kOsAndroid,
|
|
|
-diff --git a/chrome/browser/android/ntp/most_visited_sites_bridge.cc b/chrome/browser/android/ntp/most_visited_sites_bridge.cc
|
|
|
---- a/chrome/browser/android/ntp/most_visited_sites_bridge.cc
|
|
|
-+++ b/chrome/browser/android/ntp/most_visited_sites_bridge.cc
|
|
|
-@@ -13,9 +13,11 @@
|
|
|
- #include "base/android/jni_array.h"
|
|
|
- #include "base/android/jni_string.h"
|
|
|
- #include "base/android/scoped_java_ref.h"
|
|
|
-+#include "base/command_line.h"
|
|
|
- #include "base/strings/string16.h"
|
|
|
- #include "base/strings/utf_string_conversions.h"
|
|
|
- #include "chrome/browser/browser_process.h"
|
|
|
-+#include "chrome/common/chrome_switches.h"
|
|
|
- #include "chrome/browser/history/history_service_factory.h"
|
|
|
- #include "chrome/browser/ntp_tiles/chrome_most_visited_sites_factory.h"
|
|
|
- #include "chrome/browser/profiles/profile.h"
|
|
|
-@@ -161,6 +163,10 @@ void MostVisitedSitesBridge::JavaObserver::OnURLsAvailable(
|
|
|
- std::vector<int> sources;
|
|
|
- std::vector<int> section_types;
|
|
|
- std::vector<int64_t> data_generation_times;
|
|
|
-+
|
|
|
-+ // do not source any tile if NTP is disabled
|
|
|
-+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
|
|
|
-+ switches::kHideNTPTiles)) {
|
|
|
- for (const auto& section : sections) {
|
|
|
- const NTPTilesVector& tiles = section.second;
|
|
|
- section_types.resize(section_types.size() + tiles.size(),
|
|
|
-@@ -175,6 +181,8 @@ void MostVisitedSitesBridge::JavaObserver::OnURLsAvailable(
|
|
|
- tile.data_generation_time.ToJavaTime());
|
|
|
- }
|
|
|
- }
|
|
|
-+ }
|
|
|
-+
|
|
|
- Java_MostVisitedSitesBridge_onURLsAvailable(
|
|
|
- env, observer_, ToJavaArrayOfStrings(env, titles),
|
|
|
- ToJavaArrayOfStrings(env, urls), ToJavaIntArray(env, section_types),
|
|
|
-diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
|
|
|
---- a/chrome/browser/flag_descriptions.cc
|
|
|
-+++ b/chrome/browser/flag_descriptions.cc
|
|
|
-@@ -189,6 +189,10 @@ const char kAwaitOptimizationName[] = "Await optimization";
|
|
|
- const char kAwaitOptimizationDescription[] =
|
|
|
- "Enables await taking 1 tick on the microtask queue.";
|
|
|
-
|
|
|
-+const char kHideNTPTilesName[] = "Hide NTP tiles";
|
|
|
-+const char kHideNTPTilesDescription[] =
|
|
|
-+ "Hide all tiles on the New Tab Page, making it effectively empty all the time.";
|
|
|
-+
|
|
|
- const char kBleAdvertisingInExtensionsName[] = "BLE Advertising in Chrome Apps";
|
|
|
- const char kBleAdvertisingInExtensionsDescription[] =
|
|
|
- "Enables BLE Advertising in Chrome Apps. BLE Advertising might interfere "
|
|
|
-diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
|
|
|
---- a/chrome/browser/flag_descriptions.h
|
|
|
-+++ b/chrome/browser/flag_descriptions.h
|
|
|
-@@ -143,6 +143,9 @@ extern const char kAutoplayPolicyDocumentUserActivation[];
|
|
|
- extern const char kAwaitOptimizationName[];
|
|
|
- extern const char kAwaitOptimizationDescription[];
|
|
|
-
|
|
|
-+extern const char kHideNTPTilesName[];
|
|
|
-+extern const char kHideNTPTilesDescription[];
|
|
|
-+
|
|
|
- extern const char kBleAdvertisingInExtensionsName[];
|
|
|
- extern const char kBleAdvertisingInExtensionsDescription[];
|
|
|
-
|
|
|
-diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
|
|
|
---- a/chrome/common/chrome_switches.cc
|
|
|
-+++ b/chrome/common/chrome_switches.cc
|
|
|
-@@ -88,6 +88,9 @@ const char kAutoSelectDesktopCaptureSource[] =
|
|
|
- const char kBypassAppBannerEngagementChecks[] =
|
|
|
- "bypass-app-banner-engagement-checks";
|
|
|
-
|
|
|
-+// Hide all New Tab Page tiles, making it effectively empty all the time.
|
|
|
-+const char kHideNTPTiles[] = "hide-ntp-tiles";
|
|
|
-+
|
|
|
- // How often (in seconds) to check for updates. Should only be used for testing
|
|
|
- // purposes.
|
|
|
- const char kCheckForUpdateIntervalSec[] = "check-for-update-interval";
|
|
|
-diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
|
|
|
---- a/chrome/common/chrome_switches.h
|
|
|
-+++ b/chrome/common/chrome_switches.h
|
|
|
-@@ -46,6 +46,7 @@ extern const char kAuthServerWhitelist[];
|
|
|
- extern const char kAutoOpenDevToolsForTabs[];
|
|
|
- extern const char kAutoSelectDesktopCaptureSource[];
|
|
|
- extern const char kBypassAppBannerEngagementChecks[];
|
|
|
-+extern const char kHideNTPTiles[];
|
|
|
- extern const char kCheckForUpdateIntervalSec[];
|
|
|
- extern const char kCipherSuiteBlacklist[];
|
|
|
- extern const char kCloudPrintFile[];
|
|
|
---
|
|
|
-2.11.0
|
|
|
-
|