Remove TiclSettingsProvider

It only had one method, UseGCMChannel(), plus corresponding observer
infrastructure. All UseGCMChannel() implementations always returned
true, so the whole thing can be removed.

Note: All the "PushClient" stuff from jingle/notifier should also be
removed eventually, but right now lots of tests still depend on it.

Bug: 912042
Change-Id: I41a9d2a2401024b36e358bc7dc22a43159554584
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1530964
Reviewed-by: Tatiana Gornak <melandory@chromium.org>
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
Reviewed-by: David Roger <droger@chromium.org>
Commit-Queue: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#643375}
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn
index c799b79..3a4e1d9 100644
--- a/chrome/browser/chromeos/BUILD.gn
+++ b/chrome/browser/chromeos/BUILD.gn
@@ -1650,8 +1650,6 @@
     "policy/status_uploader.h",
     "policy/system_log_uploader.cc",
     "policy/system_log_uploader.h",
-    "policy/ticl_device_settings_provider.cc",
-    "policy/ticl_device_settings_provider.h",
     "policy/tpm_auto_update_mode_policy_handler.cc",
     "policy/tpm_auto_update_mode_policy_handler.h",
     "policy/upload_job.h",
diff --git a/chrome/browser/chromeos/policy/affiliated_invalidation_service_provider_impl.cc b/chrome/browser/chromeos/policy/affiliated_invalidation_service_provider_impl.cc
index 2260605..403e179 100644
--- a/chrome/browser/chromeos/policy/affiliated_invalidation_service_provider_impl.cc
+++ b/chrome/browser/chromeos/policy/affiliated_invalidation_service_provider_impl.cc
@@ -15,7 +15,6 @@
 #include "chrome/browser/chrome_content_browser_client.h"
 #include "chrome/browser/chrome_notification_types.h"
 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
-#include "chrome/browser/chromeos/policy/ticl_device_settings_provider.h"
 #include "chrome/browser/chromeos/profiles/profile_helper.h"
 #include "chrome/browser/chromeos/settings/device_identity_provider.h"
 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h"
@@ -27,7 +26,6 @@
 #include "components/invalidation/impl/invalidator_storage.h"
 #include "components/invalidation/impl/profile_invalidation_provider.h"
 #include "components/invalidation/impl/ticl_invalidation_service.h"
-#include "components/invalidation/impl/ticl_settings_provider.h"
 #include "components/invalidation/public/identity_provider.h"
 #include "components/invalidation/public/invalidation_handler.h"
 #include "components/invalidation/public/invalidation_service.h"
@@ -352,8 +350,6 @@
     device_invalidation_service_ =
         std::make_unique<invalidation::TiclInvalidationService>(
             GetUserAgent(), identity_provider_.get(),
-            std::unique_ptr<invalidation::TiclSettingsProvider>(
-                new TiclDeviceSettingsProvider),
             g_browser_process->gcm_driver(),
             base::BindRepeating(&RequestProxyResolvingSocketFactory),
             base::CreateSingleThreadTaskRunnerWithTraits(
diff --git a/chrome/browser/chromeos/policy/ticl_device_settings_provider.cc b/chrome/browser/chromeos/policy/ticl_device_settings_provider.cc
deleted file mode 100644
index f4a25b0..0000000
--- a/chrome/browser/chromeos/policy/ticl_device_settings_provider.cc
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/chromeos/policy/ticl_device_settings_provider.h"
-
-#include "base/command_line.h"
-#include "components/invalidation/impl/invalidation_switches.h"
-
-namespace policy {
-
-TiclDeviceSettingsProvider::TiclDeviceSettingsProvider() {
-}
-
-TiclDeviceSettingsProvider::~TiclDeviceSettingsProvider() {
-}
-
-bool TiclDeviceSettingsProvider::UseGCMChannel() const {
-  return true;
-}
-
-}  // namespace policy
diff --git a/chrome/browser/chromeos/policy/ticl_device_settings_provider.h b/chrome/browser/chromeos/policy/ticl_device_settings_provider.h
deleted file mode 100644
index 58d85ba3..0000000
--- a/chrome/browser/chromeos/policy/ticl_device_settings_provider.h
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_CHROMEOS_POLICY_TICL_DEVICE_SETTINGS_PROVIDER_H_
-#define CHROME_BROWSER_CHROMEOS_POLICY_TICL_DEVICE_SETTINGS_PROVIDER_H_
-
-#include "base/compiler_specific.h"
-#include "base/macros.h"
-#include "components/invalidation/impl/ticl_settings_provider.h"
-
-namespace policy {
-
-// A specialization of TiclSettingsProvider to be used by a device-wide
-// TiclInvalidationService.
-class TiclDeviceSettingsProvider : public invalidation::TiclSettingsProvider {
- public:
-  TiclDeviceSettingsProvider();
-  ~TiclDeviceSettingsProvider() override;
-
-  // TiclInvalidationServiceSettingsProvider:
-  bool UseGCMChannel() const override;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(TiclDeviceSettingsProvider);
-};
-
-}  // namespace policy
-
-#endif  // CHROME_BROWSER_CHROMEOS_POLICY_TICL_DEVICE_SETTINGS_PROVIDER_H_
diff --git a/chrome/browser/invalidation/deprecated_profile_invalidation_provider_factory.cc b/chrome/browser/invalidation/deprecated_profile_invalidation_provider_factory.cc
index b86a008..1812382 100644
--- a/chrome/browser/invalidation/deprecated_profile_invalidation_provider_factory.cc
+++ b/chrome/browser/invalidation/deprecated_profile_invalidation_provider_factory.cc
@@ -24,8 +24,6 @@
 #include "components/invalidation/impl/profile_identity_provider.h"
 #include "components/invalidation/impl/profile_invalidation_provider.h"
 #include "components/invalidation/impl/ticl_invalidation_service.h"
-#include "components/invalidation/impl/ticl_profile_settings_provider.h"
-#include "components/invalidation/impl/ticl_settings_provider.h"
 #include "components/invalidation/public/invalidation_service.h"
 #include "components/keyed_service/content/browser_context_dependency_manager.h"
 #include "components/pref_registry/pref_registry_syncable.h"
@@ -165,7 +163,6 @@
   std::unique_ptr<TiclInvalidationService> service =
       std::make_unique<TiclInvalidationService>(
           GetUserAgent(), identity_provider.get(),
-          std::make_unique<TiclProfileSettingsProvider>(profile->GetPrefs()),
           gcm::GCMProfileServiceFactory::GetForProfile(profile)->driver(),
           base::BindRepeating(&RequestProxyResolvingSocketFactory, profile),
           base::CreateSingleThreadTaskRunnerWithTraits(
diff --git a/chrome/browser/invalidation/profile_invalidation_provider_factory.cc b/chrome/browser/invalidation/profile_invalidation_provider_factory.cc
index 3bfc7c8..4c30e39 100644
--- a/chrome/browser/invalidation/profile_invalidation_provider_factory.cc
+++ b/chrome/browser/invalidation/profile_invalidation_provider_factory.cc
@@ -23,9 +23,6 @@
 #include "components/invalidation/impl/invalidator_storage.h"
 #include "components/invalidation/impl/profile_identity_provider.h"
 #include "components/invalidation/impl/profile_invalidation_provider.h"
-#include "components/invalidation/impl/ticl_invalidation_service.h"
-#include "components/invalidation/impl/ticl_profile_settings_provider.h"
-#include "components/invalidation/impl/ticl_settings_provider.h"
 #include "components/invalidation/public/invalidation_service.h"
 #include "components/keyed_service/content/browser_context_dependency_manager.h"
 #include "components/pref_registry/pref_registry_syncable.h"
diff --git a/components/invalidation/impl/BUILD.gn b/components/invalidation/impl/BUILD.gn
index 428af94..a9e1473 100644
--- a/components/invalidation/impl/BUILD.gn
+++ b/components/invalidation/impl/BUILD.gn
@@ -117,10 +117,6 @@
       "sync_system_resources.h",
       "ticl_invalidation_service.cc",
       "ticl_invalidation_service.h",
-      "ticl_profile_settings_provider.cc",
-      "ticl_profile_settings_provider.h",
-      "ticl_settings_provider.cc",
-      "ticl_settings_provider.h",
     ]
   }
 
@@ -200,7 +196,6 @@
       "sync_invalidation_listener_unittest.cc",
       "sync_system_resources_unittest.cc",
       "ticl_invalidation_service_unittest.cc",
-      "ticl_profile_settings_provider_unittest.cc",
       "unacked_invalidation_set_unittest.cc",
     ]
   }
diff --git a/components/invalidation/impl/ticl_invalidation_service.cc b/components/invalidation/impl/ticl_invalidation_service.cc
index a1229d6..6850cec 100644
--- a/components/invalidation/impl/ticl_invalidation_service.cc
+++ b/components/invalidation/impl/ticl_invalidation_service.cc
@@ -59,7 +59,6 @@
 TiclInvalidationService::TiclInvalidationService(
     const std::string& user_agent,
     IdentityProvider* identity_provider,
-    std::unique_ptr<TiclSettingsProvider> settings_provider,
     gcm::GCMDriver* gcm_driver,
     base::RepeatingCallback<
         void(base::WeakPtr<TiclInvalidationService>,
@@ -70,10 +69,8 @@
     network::NetworkConnectionTracker* network_connection_tracker)
     : user_agent_(user_agent),
       identity_provider_(identity_provider),
-      settings_provider_(std::move(settings_provider)),
       invalidator_registrar_(new syncer::DeprecatedInvalidatorRegistrar()),
       request_access_token_backoff_(&kRequestAccessTokenBackoffPolicy),
-      network_channel_type_(GCM_NETWORK_CHANNEL),
       gcm_driver_(gcm_driver),
       network_task_runner_(network_task_runner),
       url_loader_factory_(std::move(url_loader_factory)),
@@ -89,7 +86,6 @@
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
   invalidator_registrar_->UpdateInvalidatorState(
       syncer::INVALIDATOR_SHUTTING_DOWN);
-  settings_provider_->RemoveObserver(this);
   identity_provider_->RemoveObserver(this);
   if (IsStarted()) {
     StopInvalidator();
@@ -107,13 +103,11 @@
         GenerateInvalidatorClientId());
   }
 
-  UpdateInvalidationNetworkChannel();
   if (IsReadyToStart()) {
-    StartInvalidator(network_channel_type_);
+    StartInvalidator();
   }
 
   identity_provider_->AddObserver(this);
-  settings_provider_->AddObserver(this);
 }
 
 void TiclInvalidationService::InitForTest(
@@ -189,7 +183,6 @@
 void TiclInvalidationService::RequestDetailedStatus(
     base::Callback<void(const base::DictionaryValue&)> return_callback) const {
   if (IsStarted()) {
-    return_callback.Run(network_channel_options_);
     invalidator_->RequestDetailedStatus(return_callback);
   }
 }
@@ -228,7 +221,7 @@
   request_access_token_backoff_.Reset();
   access_token_ = access_token;
   if (!IsStarted() && IsReadyToStart()) {
-    StartInvalidator(network_channel_type_);
+    StartInvalidator();
   } else {
     UpdateInvalidatorCredentials();
   }
@@ -262,12 +255,12 @@
 
 void TiclInvalidationService::OnActiveAccountLogin() {
   if (!IsStarted() && IsReadyToStart())
-    StartInvalidator(network_channel_type_);
+    StartInvalidator();
 }
 
 void TiclInvalidationService::OnActiveAccountRefreshTokenUpdated() {
   if (!IsStarted() && IsReadyToStart())
-    StartInvalidator(network_channel_type_);
+    StartInvalidator();
 }
 
 void TiclInvalidationService::OnActiveAccountRefreshTokenRemoved() {
@@ -294,10 +287,6 @@
       ClearAndSetNewClientId(GenerateInvalidatorClientId());
 }
 
-void TiclInvalidationService::OnUseGCMChannelChanged() {
-  UpdateInvalidationNetworkChannel();
-}
-
 void TiclInvalidationService::OnInvalidatorStateChange(
     syncer::InvalidatorState state) {
   UMA_HISTOGRAM_ENUMERATION("Invalidations.StatusChanged", state);
@@ -345,66 +334,34 @@
   return invalidator_ != nullptr;
 }
 
-void TiclInvalidationService::StartInvalidator(
-    InvalidationNetworkChannel network_channel) {
+void TiclInvalidationService::StartInvalidator() {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
   DCHECK(!invalidator_);
   DCHECK(invalidation_state_tracker_);
   DCHECK(!invalidation_state_tracker_->GetInvalidatorClientId().empty());
 
-  // Request access token for PushClientChannel. GCMNetworkChannel will request
-  // access token before sending message to server.
-  if (network_channel == PUSH_CLIENT_CHANNEL && access_token_.empty()) {
-    DVLOG(1)
-        << "TiclInvalidationService: "
-        << "Deferring start until we have an access token.";
-    RequestAccessToken();
-    return;
-  }
+  gcm_invalidation_bridge_ =
+      std::make_unique<GCMInvalidationBridge>(gcm_driver_, identity_provider_);
+  syncer::NetworkChannelCreator network_channel_creator =
+      syncer::NonBlockingInvalidator::MakeGCMNetworkChannelCreator(
+          url_loader_factory_->Clone(), network_connection_tracker_,
+          gcm_invalidation_bridge_->CreateDelegate());
 
-  syncer::NetworkChannelCreator network_channel_creator;
-
-  switch (network_channel) {
-    case PUSH_CLIENT_CHANNEL: {
-      notifier::NotifierOptions options =
-          ParseNotifierOptions(*base::CommandLine::ForCurrentProcess());
-      options.network_connection_tracker = network_connection_tracker_;
-      options.network_config.get_proxy_resolving_socket_factory_callback =
-          get_socket_factory_callback_;
-      options.network_config.task_runner = network_task_runner_;
-      options.auth_mechanism = "X-OAUTH2";
-      network_channel_options_.SetString("Options.HostPort",
-                                         options.xmpp_host_port.ToString());
-      network_channel_options_.SetString("Options.AuthMechanism",
-                                         options.auth_mechanism);
-      DCHECK_EQ(notifier::NOTIFICATION_SERVER, options.notification_method);
-      network_channel_creator =
-          syncer::NonBlockingInvalidator::MakePushClientChannelCreator(options);
-      break;
-    }
-    case GCM_NETWORK_CHANNEL: {
-      gcm_invalidation_bridge_ = std::make_unique<GCMInvalidationBridge>(
-          gcm_driver_, identity_provider_);
-      network_channel_creator =
-          syncer::NonBlockingInvalidator::MakeGCMNetworkChannelCreator(
-              url_loader_factory_->Clone(), network_connection_tracker_,
-              gcm_invalidation_bridge_->CreateDelegate());
-      break;
-    }
-    default: {
-      NOTREACHED();
-      return;
-    }
-  }
-
-  UMA_HISTOGRAM_ENUMERATION(
-      "Invalidations.NetworkChannel", network_channel, NETWORK_CHANNELS_COUNT);
-  invalidator_.reset(new syncer::NonBlockingInvalidator(
+  // TODO(crbug.com/912042): Deprecate this histogram, now that it only has one
+  // possible value.
+  enum InvalidationNetworkChannel {
+    // Deprecated: PUSH_CLIENT_CHANNEL = 0,
+    GCM_NETWORK_CHANNEL = 1,
+    NETWORK_CHANNELS_COUNT = 2
+  };
+  UMA_HISTOGRAM_ENUMERATION("Invalidations.NetworkChannel", GCM_NETWORK_CHANNEL,
+                            NETWORK_CHANNELS_COUNT);
+  invalidator_ = std::make_unique<syncer::NonBlockingInvalidator>(
       network_channel_creator,
       invalidation_state_tracker_->GetInvalidatorClientId(),
       invalidation_state_tracker_->GetSavedInvalidations(),
       invalidation_state_tracker_->GetBootstrapData(),
-      invalidation_state_tracker_.get(), user_agent_, network_task_runner_));
+      invalidation_state_tracker_.get(), user_agent_, network_task_runner_);
 
   UpdateInvalidatorCredentials();
 
@@ -413,19 +370,6 @@
       this, invalidator_registrar_->GetAllRegisteredIds()));
 }
 
-void TiclInvalidationService::UpdateInvalidationNetworkChannel() {
-  const InvalidationNetworkChannel network_channel_type =
-      settings_provider_->UseGCMChannel() ? GCM_NETWORK_CHANNEL
-                                          : PUSH_CLIENT_CHANNEL;
-  if (network_channel_type_ == network_channel_type)
-    return;
-  network_channel_type_ = network_channel_type;
-  if (IsStarted()) {
-    StopInvalidator();
-    StartInvalidator(network_channel_type_);
-  }
-}
-
 void TiclInvalidationService::UpdateInvalidatorCredentials() {
   std::string email = identity_provider_->GetActiveAccountId();
 
diff --git a/components/invalidation/impl/ticl_invalidation_service.h b/components/invalidation/impl/ticl_invalidation_service.h
index f62037a..37555e4 100644
--- a/components/invalidation/impl/ticl_invalidation_service.h
+++ b/components/invalidation/impl/ticl_invalidation_service.h
@@ -17,7 +17,6 @@
 #include "base/values.h"
 #include "components/invalidation/impl/deprecated_invalidator_registrar.h"
 #include "components/invalidation/impl/invalidation_logger.h"
-#include "components/invalidation/impl/ticl_settings_provider.h"
 #include "components/invalidation/public/identity_provider.h"
 #include "components/invalidation/public/invalidation_handler.h"
 #include "components/invalidation/public/invalidation_service.h"
@@ -46,22 +45,11 @@
 // It provides invalidations for desktop platforms (Win, Mac, Linux).
 class TiclInvalidationService : public InvalidationService,
                                 public IdentityProvider::Observer,
-                                public TiclSettingsProvider::Observer,
                                 public syncer::InvalidationHandler {
  public:
-  enum InvalidationNetworkChannel {
-    PUSH_CLIENT_CHANNEL = 0,
-    GCM_NETWORK_CHANNEL = 1,
-
-    // This enum is used in UMA_HISTOGRAM_ENUMERATION. Insert new values above
-    // this line.
-    NETWORK_CHANNELS_COUNT = 2
-  };
-
   TiclInvalidationService(
       const std::string& user_agent,
       IdentityProvider* identity_provider,
-      std::unique_ptr<TiclSettingsProvider> settings_provider,
       gcm::GCMDriver* gcm_driver,
       // |get_socket_factory_callback| will be safe to call on the IO thread,
       // but will check its WeakPtr parameter on the UI thread.
@@ -104,9 +92,6 @@
   void OnActiveAccountLogin() override;
   void OnActiveAccountLogout() override;
 
-  // TiclSettingsProvider::Observer implementation.
-  void OnUseGCMChannelChanged() override;
-
   // syncer::InvalidationHandler implementation.
   void OnInvalidatorStateChange(syncer::InvalidatorState state) override;
   void OnIncomingInvalidation(
@@ -121,20 +106,17 @@
 
  private:
   friend class TiclInvalidationServiceTestDelegate;
-  friend class TiclProfileSettingsProviderTest;
 
   bool IsReadyToStart();
   bool IsStarted() const;
 
-  void StartInvalidator(InvalidationNetworkChannel network_channel);
-  void UpdateInvalidationNetworkChannel();
+  void StartInvalidator();
   void UpdateInvalidatorCredentials();
   void StopInvalidator();
 
   const std::string user_agent_;
 
   IdentityProvider* identity_provider_;
-  std::unique_ptr<TiclSettingsProvider> settings_provider_;
 
   std::unique_ptr<syncer::DeprecatedInvalidatorRegistrar>
       invalidator_registrar_;
@@ -151,7 +133,6 @@
   base::OneShotTimer request_access_token_retry_timer_;
   net::BackoffEntry request_access_token_backoff_;
 
-  InvalidationNetworkChannel network_channel_type_;
   gcm::GCMDriver* gcm_driver_;
   std::unique_ptr<GCMInvalidationBridge> gcm_invalidation_bridge_;
   base::RepeatingCallback<void(
@@ -165,10 +146,6 @@
   // and invalidations.
   InvalidationLogger logger_;
 
-  // Keep a copy of the important parameters used in network channel creation
-  // for debugging.
-  base::DictionaryValue network_channel_options_;
-
   SEQUENCE_CHECKER(sequence_checker_);
 
   // Used on the UI thread.
diff --git a/components/invalidation/impl/ticl_invalidation_service_unittest.cc b/components/invalidation/impl/ticl_invalidation_service_unittest.cc
index 12ce25a..02c40e3 100644
--- a/components/invalidation/impl/ticl_invalidation_service_unittest.cc
+++ b/components/invalidation/impl/ticl_invalidation_service_unittest.cc
@@ -29,32 +29,6 @@
 
 namespace invalidation {
 
-namespace {
-
-class FakeTiclSettingsProvider : public TiclSettingsProvider {
- public:
-  FakeTiclSettingsProvider();
-  ~FakeTiclSettingsProvider() override;
-
-  // TiclSettingsProvider:
-  bool UseGCMChannel() const override;
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(FakeTiclSettingsProvider);
-};
-
-FakeTiclSettingsProvider::FakeTiclSettingsProvider() {
-}
-
-FakeTiclSettingsProvider::~FakeTiclSettingsProvider() {
-}
-
-bool FakeTiclSettingsProvider::UseGCMChannel() const {
-  return false;
-}
-
-}  // namespace
-
 class TiclInvalidationServiceTestDelegate {
  public:
   TiclInvalidationServiceTestDelegate() {}
@@ -74,7 +48,6 @@
     DCHECK(identity_provider_);
     invalidation_service_ = std::make_unique<TiclInvalidationService>(
         "TestUserAgent", identity_provider_.get(),
-        std::unique_ptr<TiclSettingsProvider>(new FakeTiclSettingsProvider),
         gcm_driver_.get(),
         base::RepeatingCallback<void(
             base::WeakPtr<TiclInvalidationService>,
diff --git a/components/invalidation/impl/ticl_profile_settings_provider.cc b/components/invalidation/impl/ticl_profile_settings_provider.cc
deleted file mode 100644
index af4364f..0000000
--- a/components/invalidation/impl/ticl_profile_settings_provider.cc
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/invalidation/impl/ticl_profile_settings_provider.h"
-
-#include "base/bind.h"
-#include "base/bind_helpers.h"
-#include "base/command_line.h"
-#include "components/gcm_driver/gcm_channel_status_syncer.h"
-#include "components/invalidation/impl/invalidation_prefs.h"
-#include "components/invalidation/impl/invalidation_switches.h"
-#include "components/pref_registry/pref_registry_syncable.h"
-#include "components/prefs/pref_service.h"
-
-namespace invalidation {
-
-TiclProfileSettingsProvider::TiclProfileSettingsProvider(PrefService* prefs)
-    : prefs_(prefs) {
-  registrar_.Init(prefs_);
-  registrar_.Add(
-      gcm::prefs::kGCMChannelStatus,
-      base::Bind(&TiclProfileSettingsProvider::FireOnUseGCMChannelChanged,
-                 base::Unretained(this)));
-}
-
-TiclProfileSettingsProvider::~TiclProfileSettingsProvider() {}
-
-bool TiclProfileSettingsProvider::UseGCMChannel() const {
-  return true;
-}
-
-}  // namespace invalidation
diff --git a/components/invalidation/impl/ticl_profile_settings_provider.h b/components/invalidation/impl/ticl_profile_settings_provider.h
deleted file mode 100644
index 15020ef..0000000
--- a/components/invalidation/impl/ticl_profile_settings_provider.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_INVALIDATION_IMPL_TICL_PROFILE_SETTINGS_PROVIDER_H_
-#define COMPONENTS_INVALIDATION_IMPL_TICL_PROFILE_SETTINGS_PROVIDER_H_
-
-#include "base/compiler_specific.h"
-#include "base/macros.h"
-#include "components/invalidation/impl/ticl_settings_provider.h"
-#include "components/prefs/pref_change_registrar.h"
-
-class PrefService;
-
-namespace invalidation {
-
-// A specialization of TiclSettingsProvider that reads settings from user prefs.
-class TiclProfileSettingsProvider : public TiclSettingsProvider {
- public:
-  explicit TiclProfileSettingsProvider(PrefService* prefs);
-  ~TiclProfileSettingsProvider() override;
-
-  // TiclInvalidationServiceSettingsProvider:
-  bool UseGCMChannel() const override;
-
- private:
-  PrefChangeRegistrar registrar_;
-  PrefService* const prefs_;
-
-  DISALLOW_COPY_AND_ASSIGN(TiclProfileSettingsProvider);
-};
-
-}  // namespace invalidation
-
-#endif  // COMPONENTS_INVALIDATION_IMPL_TICL_PROFILE_SETTINGS_PROVIDER_H_
diff --git a/components/invalidation/impl/ticl_profile_settings_provider_unittest.cc b/components/invalidation/impl/ticl_profile_settings_provider_unittest.cc
deleted file mode 100644
index 916494d..0000000
--- a/components/invalidation/impl/ticl_profile_settings_provider_unittest.cc
+++ /dev/null
@@ -1,118 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/invalidation/impl/ticl_profile_settings_provider.h"
-
-#include <memory>
-
-#include "base/bind.h"
-#include "base/macros.h"
-#include "base/test/scoped_task_environment.h"
-#include "base/threading/thread_task_runner_handle.h"
-#include "components/gcm_driver/fake_gcm_driver.h"
-#include "components/gcm_driver/gcm_channel_status_syncer.h"
-#include "components/invalidation/impl/fake_invalidation_state_tracker.h"
-#include "components/invalidation/impl/invalidation_prefs.h"
-#include "components/invalidation/impl/invalidation_state_tracker.h"
-#include "components/invalidation/impl/profile_identity_provider.h"
-#include "components/invalidation/impl/profile_invalidation_provider.h"
-#include "components/invalidation/impl/ticl_invalidation_service.h"
-#include "components/invalidation/impl/ticl_settings_provider.h"
-#include "components/prefs/pref_service.h"
-#include "components/sync_preferences/testing_pref_service_syncable.h"
-#include "jingle/glue/network_service_config_test_util.h"
-#include "net/url_request/url_request_context_getter.h"
-#include "net/url_request/url_request_test_util.h"
-#include "services/identity/public/cpp/identity_test_environment.h"
-#include "services/network/public/cpp/shared_url_loader_factory.h"
-#include "services/network/test/test_network_connection_tracker.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace invalidation {
-
-class TiclProfileSettingsProviderTest : public testing::Test {
- protected:
-  TiclProfileSettingsProviderTest();
-  ~TiclProfileSettingsProviderTest() override;
-
-  // testing::Test:
-  void SetUp() override;
-
-  TiclInvalidationService::InvalidationNetworkChannel GetNetworkChannel();
-
-  base::test::ScopedTaskEnvironment task_environment_;
-  std::unique_ptr<jingle_glue::NetworkServiceConfigTestUtil> net_config_helper_;
-  gcm::FakeGCMDriver gcm_driver_;
-
-  // |identity_test_env_| should be declared before |identity_provider_|
-  // in order to ensure correct destruction order.
-  identity::IdentityTestEnvironment identity_test_env_;
-  std::unique_ptr<invalidation::IdentityProvider> identity_provider_;
-
-  sync_preferences::TestingPrefServiceSyncable pref_service_;
-
-  // The service has to be below the provider since the service keeps
-  // a non-owned pointer to the provider.
-  std::unique_ptr<TiclInvalidationService> invalidation_service_;
-
- private:
-  void RequestSocket(
-      base::WeakPtr<TiclInvalidationService> service,
-      network::mojom::ProxyResolvingSocketFactoryRequest request) {
-    net_config_helper_->MakeSocketFactoryCallback().Run(std::move(request));
-  }
-  DISALLOW_COPY_AND_ASSIGN(TiclProfileSettingsProviderTest);
-};
-
-TiclProfileSettingsProviderTest::TiclProfileSettingsProviderTest() {}
-
-TiclProfileSettingsProviderTest::~TiclProfileSettingsProviderTest() {}
-
-void TiclProfileSettingsProviderTest::SetUp() {
-  gcm::GCMChannelStatusSyncer::RegisterProfilePrefs(pref_service_.registry());
-  ProfileInvalidationProvider::RegisterProfilePrefs(pref_service_.registry());
-
-  net_config_helper_ =
-      std::make_unique<jingle_glue::NetworkServiceConfigTestUtil>(
-          base::MakeRefCounted<net::TestURLRequestContextGetter>(
-              base::ThreadTaskRunnerHandle::Get()));
-  identity_provider_ = std::make_unique<ProfileIdentityProvider>(
-      identity_test_env_.identity_manager());
-
-  invalidation_service_ = std::make_unique<TiclInvalidationService>(
-      "TestUserAgent", identity_provider_.get(),
-      std::unique_ptr<TiclSettingsProvider>(
-          new TiclProfileSettingsProvider(&pref_service_)),
-      &gcm_driver_,
-      base::BindRepeating(&TiclProfileSettingsProviderTest::RequestSocket,
-                          base::Unretained(this)),
-      base::ThreadTaskRunnerHandle::Get(), nullptr /* url_loader_factory */,
-      network::TestNetworkConnectionTracker::GetInstance());
-  invalidation_service_->Init(std::unique_ptr<syncer::InvalidationStateTracker>(
-      new syncer::FakeInvalidationStateTracker));
-}
-
-TiclInvalidationService::InvalidationNetworkChannel
-TiclProfileSettingsProviderTest::GetNetworkChannel() {
-  return invalidation_service_->network_channel_type_;
-}
-
-TEST_F(TiclProfileSettingsProviderTest, ChannelSelectionTest) {
-  // Default value should be GCM channel.
-  EXPECT_EQ(TiclInvalidationService::GCM_NETWORK_CHANNEL, GetNetworkChannel());
-
-  // If GCM is enabled then use GCM channel.
-  pref_service_.SetBoolean(gcm::prefs::kGCMChannelStatus, true);
-  EXPECT_EQ(TiclInvalidationService::GCM_NETWORK_CHANNEL, GetNetworkChannel());
-
-  pref_service_.ClearPref(gcm::prefs::kGCMChannelStatus);
-  EXPECT_EQ(TiclInvalidationService::GCM_NETWORK_CHANNEL, GetNetworkChannel());
-
-  // If invalidation channel setting says use GCM but GCM is not enabled, do not
-  // fall back to push channel.
-  pref_service_.SetBoolean(gcm::prefs::kGCMChannelStatus, false);
-  EXPECT_EQ(TiclInvalidationService::GCM_NETWORK_CHANNEL, GetNetworkChannel());
-}
-
-}  // namespace invalidation
diff --git a/components/invalidation/impl/ticl_settings_provider.cc b/components/invalidation/impl/ticl_settings_provider.cc
deleted file mode 100644
index c8b7adc..0000000
--- a/components/invalidation/impl/ticl_settings_provider.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/invalidation/impl/ticl_settings_provider.h"
-
-namespace invalidation {
-
-TiclSettingsProvider::Observer::~Observer() {
-}
-
-TiclSettingsProvider::TiclSettingsProvider() {
-}
-
-TiclSettingsProvider::~TiclSettingsProvider() {
-}
-
-void TiclSettingsProvider::AddObserver(Observer* observer) {
-  observers_.AddObserver(observer);
-}
-
-void TiclSettingsProvider::RemoveObserver(Observer* observer) {
-  observers_.RemoveObserver(observer);
-}
-
-void TiclSettingsProvider::FireOnUseGCMChannelChanged() {
-  for (auto& observer : observers_)
-    observer.OnUseGCMChannelChanged();
-}
-
-}  // namespace invalidation
diff --git a/components/invalidation/impl/ticl_settings_provider.h b/components/invalidation/impl/ticl_settings_provider.h
deleted file mode 100644
index 2f4372b..0000000
--- a/components/invalidation/impl/ticl_settings_provider.h
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_INVALIDATION_IMPL_TICL_SETTINGS_PROVIDER_H_
-#define COMPONENTS_INVALIDATION_IMPL_TICL_SETTINGS_PROVIDER_H_
-
-#include "base/macros.h"
-#include "base/observer_list.h"
-
-namespace invalidation {
-
-// Provides configuration settings to TiclInvalidationService and notifies it
-// when the settings change.
-class TiclSettingsProvider {
- public:
-  class Observer {
-   public:
-    virtual void OnUseGCMChannelChanged() = 0;
-
-   protected:
-    virtual ~Observer();
-  };
-
-  TiclSettingsProvider();
-  virtual ~TiclSettingsProvider();
-
-  virtual bool UseGCMChannel() const = 0;
-
-  void AddObserver(Observer* observer);
-  void RemoveObserver(Observer* observer);
-
- protected:
-  void FireOnUseGCMChannelChanged();
-
- private:
-  base::ObserverList<Observer, true>::Unchecked observers_;
-
-  DISALLOW_COPY_AND_ASSIGN(TiclSettingsProvider);
-};
-
-}  // namespace invalidation
-
-#endif  // COMPONENTS_INVALIDATION_IMPL_TICL_SETTINGS_PROVIDER_H_
diff --git a/ios/chrome/browser/invalidation/ios_chrome_deprecated_profile_invalidation_provider_factory.mm b/ios/chrome/browser/invalidation/ios_chrome_deprecated_profile_invalidation_provider_factory.mm
index e2cc2e8..75f44e7 100644
--- a/ios/chrome/browser/invalidation/ios_chrome_deprecated_profile_invalidation_provider_factory.mm
+++ b/ios/chrome/browser/invalidation/ios_chrome_deprecated_profile_invalidation_provider_factory.mm
@@ -16,7 +16,6 @@
 #include "components/invalidation/impl/profile_identity_provider.h"
 #include "components/invalidation/impl/profile_invalidation_provider.h"
 #include "components/invalidation/impl/ticl_invalidation_service.h"
-#include "components/invalidation/impl/ticl_profile_settings_provider.h"
 #include "components/keyed_service/ios/browser_state_dependency_manager.h"
 #include "components/pref_registry/pref_registry_syncable.h"
 #include "components/prefs/pref_registry.h"
@@ -101,8 +100,6 @@
   std::unique_ptr<TiclInvalidationService> service(new TiclInvalidationService(
       web::GetWebClient()->GetUserAgent(web::UserAgentType::MOBILE),
       identity_provider.get(),
-      std::make_unique<invalidation::TiclProfileSettingsProvider>(
-          browser_state->GetPrefs()),
       IOSChromeGCMProfileServiceFactory::GetForBrowserState(browser_state)
           ->driver(),
       base::BindRepeating(&RequestProxyResolvingSocketFactory, browser_state),
diff --git a/ios/web_view/internal/sync/web_view_profile_invalidation_provider_factory.mm b/ios/web_view/internal/sync/web_view_profile_invalidation_provider_factory.mm
index 3a5d740..aab709d 100644
--- a/ios/web_view/internal/sync/web_view_profile_invalidation_provider_factory.mm
+++ b/ios/web_view/internal/sync/web_view_profile_invalidation_provider_factory.mm
@@ -16,7 +16,6 @@
 #include "components/invalidation/impl/profile_identity_provider.h"
 #include "components/invalidation/impl/profile_invalidation_provider.h"
 #include "components/invalidation/impl/ticl_invalidation_service.h"
-#include "components/invalidation/impl/ticl_profile_settings_provider.h"
 #include "components/keyed_service/ios/browser_state_dependency_manager.h"
 #include "components/pref_registry/pref_registry_syncable.h"
 #include "components/prefs/pref_registry.h"
@@ -101,8 +100,6 @@
   std::unique_ptr<TiclInvalidationService> service(new TiclInvalidationService(
       web::GetWebClient()->GetUserAgent(web::UserAgentType::MOBILE),
       identity_provider.get(),
-      std::make_unique<invalidation::TiclProfileSettingsProvider>(
-          browser_state->GetPrefs()),
       WebViewGCMProfileServiceFactory::GetForBrowserState(browser_state)
           ->driver(),
       base::BindRepeating(&RequestProxyResolvingSocketFactory, browser_state),