Remove --safebrowsing-disable-auto-update switch.

The switch was not used for PVer4 so there should be no effect of
removing it.

Bug: 74848
Change-Id: Ia9c0bc55f56acde7fb4f5112ff6b0f94de4fcfe2

TBR=sky
(minor changes under chrome/test)

Change-Id: Ia9c0bc55f56acde7fb4f5112ff6b0f94de4fcfe2
Reviewed-on: https://chromium-review.googlesource.com/777789
Reviewed-by: Varun Khaneja <vakh@chromium.org>
Reviewed-by: Nate Fischer <ntfschr@chromium.org>
Reviewed-by: Jialiu Lin <jialiul@chromium.org>
Commit-Queue: Varun Khaneja <vakh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518507}
diff --git a/android_webview/browser/aw_safe_browsing_ui_manager.cc b/android_webview/browser/aw_safe_browsing_ui_manager.cc
index b74ae0c..c08faff 100644
--- a/android_webview/browser/aw_safe_browsing_ui_manager.cc
+++ b/android_webview/browser/aw_safe_browsing_ui_manager.cc
@@ -15,7 +15,6 @@
 #include "components/safe_browsing/base_ui_manager.h"
 #include "components/safe_browsing/browser/safe_browsing_url_request_context_getter.h"
 #include "components/safe_browsing/common/safebrowsing_constants.h"
-#include "components/safe_browsing/common/safebrowsing_switches.h"
 #include "content/public/browser/browser_thread.h"
 
 using content::BrowserThread;
@@ -99,9 +98,7 @@
     // Lazy creation of ping manager, needs to happen on IO thread.
     safe_browsing::SafeBrowsingProtocolConfig config;
     config.client_name = GetProtocolConfigClientName();
-    base::CommandLine* cmdline = ::base::CommandLine::ForCurrentProcess();
-    config.disable_auto_update =
-        cmdline->HasSwitch(::safe_browsing::switches::kSbDisableAutoUpdate);
+    config.disable_auto_update = false;
     config.url_prefix = ::safe_browsing::kSbDefaultURLPrefix;
     config.backup_connect_error_url_prefix =
         ::safe_browsing::kSbBackupConnectErrorURLPrefix;
diff --git a/chrome/browser/safe_browsing/client_side_model_loader.cc b/chrome/browser/safe_browsing/client_side_model_loader.cc
index c1da018..f10c995 100644
--- a/chrome/browser/safe_browsing/client_side_model_loader.cc
+++ b/chrome/browser/safe_browsing/client_side_model_loader.cc
@@ -18,7 +18,6 @@
 #include "chrome/common/safe_browsing/client_model.pb.h"
 #include "components/data_use_measurement/core/data_use_user_data.h"
 #include "components/safe_browsing/common/safebrowsing_messages.h"
-#include "components/safe_browsing/common/safebrowsing_switches.h"
 #include "components/safe_browsing/proto/csd.pb.h"
 #include "components/variations/variations_associated_data.h"
 #include "net/base/load_flags.h"
@@ -237,9 +236,6 @@
 
 void ModelLoader::ScheduleFetch(int64_t delay_ms) {
   DCHECK(fetch_sequence_checker_.CalledOnValidSequence());
-  if (base::CommandLine::ForCurrentProcess()->HasSwitch(
-          safe_browsing::switches::kSbDisableAutoUpdate))
-    return;
   base::SequencedTaskRunnerHandle::Get()->PostDelayedTask(
       FROM_HERE,
       base::BindOnce(&ModelLoader::StartFetch, weak_factory_.GetWeakPtr()),
diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc
index f1d412a..cc60615 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service.cc
@@ -37,7 +37,6 @@
 #include "components/prefs/pref_service.h"
 #include "components/safe_browsing/browser/safe_browsing_url_request_context_getter.h"
 #include "components/safe_browsing/common/safebrowsing_constants.h"
-#include "components/safe_browsing/common/safebrowsing_switches.h"
 #include "components/safe_browsing/db/database_manager.h"
 #include "components/safe_browsing/db/v4_feature_list.h"
 #include "components/safe_browsing/db/v4_get_hash_protocol_manager.h"
@@ -328,7 +327,6 @@
 
   base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
   config.disable_auto_update =
-      cmdline->HasSwitch(safe_browsing::switches::kSbDisableAutoUpdate) ||
       cmdline->HasSwitch(::switches::kDisableBackgroundNetworking);
   config.url_prefix = kSbDefaultURLPrefix;
   config.backup_connect_error_url_prefix = kSbBackupConnectErrorURLPrefix;
diff --git a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
index 8cdbe07..956d23f 100644
--- a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc
@@ -59,7 +59,6 @@
 #include "components/bookmarks/browser/startup_task_runner_service.h"
 #include "components/content_settings/core/browser/host_content_settings_map.h"
 #include "components/prefs/pref_service.h"
-#include "components/safe_browsing/common/safebrowsing_switches.h"
 #include "components/safe_browsing/db/database_manager.h"
 #include "components/safe_browsing/db/metadata.pb.h"
 #include "components/safe_browsing/db/notification_types.h"
@@ -615,10 +614,6 @@
   }
 
   void SetUpCommandLine(base::CommandLine* command_line) override {
-    // Makes sure the auto update is not triggered during the test.
-    // This test will fill up the database using testing prefixes
-    // and urls.
-    command_line->AppendSwitch(safe_browsing::switches::kSbDisableAutoUpdate);
 #if defined(OS_CHROMEOS)
     command_line->AppendSwitch(
         chromeos::switches::kIgnoreUserProfileMappingForTests);
diff --git a/chrome/test/base/test_launcher_utils.cc b/chrome/test/base/test_launcher_utils.cc
index 0ae1e70..5fec83f 100644
--- a/chrome/test/base/test_launcher_utils.cc
+++ b/chrome/test/base/test_launcher_utils.cc
@@ -16,7 +16,6 @@
 #include "chrome/common/chrome_paths.h"
 #include "chrome/common/chrome_switches.h"
 #include "components/os_crypt/os_crypt_switches.h"
-#include "components/safe_browsing/common/safebrowsing_switches.h"
 #include "content/public/common/content_switches.h"
 
 #if defined(USE_AURA)
@@ -42,9 +41,6 @@
   if (!command_line->HasSwitch(switches::kEnableLogging))
     command_line->AppendSwitchASCII(switches::kEnableLogging, "stderr");
 
-  // Disable safebrowsing autoupdate.
-  command_line->AppendSwitch(safe_browsing::switches::kSbDisableAutoUpdate);
-
   // Don't install default apps.
   command_line->AppendSwitch(switches::kDisableDefaultApps);
 
diff --git a/chrome/test/chromedriver/chrome_launcher.cc b/chrome/test/chromedriver/chrome_launcher.cc
index 7df7480..1b07fd87 100644
--- a/chrome/test/chromedriver/chrome_launcher.cc
+++ b/chrome/test/chromedriver/chrome_launcher.cc
@@ -76,7 +76,6 @@
     "no-first-run",
     "disable-background-networking",
     "disable-web-resources",
-    "safebrowsing-disable-auto-update",
     "disable-client-side-phishing-detection",
     "disable-default-apps",
     "enable-logging",
diff --git a/components/safe_browsing/common/safebrowsing_switches.cc b/components/safe_browsing/common/safebrowsing_switches.cc
index 04fb912..d7a4fe9 100644
--- a/components/safe_browsing/common/safebrowsing_switches.cc
+++ b/components/safe_browsing/common/safebrowsing_switches.cc
@@ -7,11 +7,6 @@
 namespace safe_browsing {
 namespace switches {
 
-// If present, safebrowsing only performs update when
-// SafeBrowsingProtocolManager::ForceScheduleNextUpdate() is explicitly called.
-// This is used for testing only.
-const char kSbDisableAutoUpdate[] = "safebrowsing-disable-auto-update";
-
 // TODO(lzheng): Remove this flag once the feature works fine
 // (http://crbug.com/74848).
 //
diff --git a/components/safe_browsing/common/safebrowsing_switches.h b/components/safe_browsing/common/safebrowsing_switches.h
index 126795b..731fc0c 100644
--- a/components/safe_browsing/common/safebrowsing_switches.h
+++ b/components/safe_browsing/common/safebrowsing_switches.h
@@ -8,7 +8,6 @@
 namespace safe_browsing {
 namespace switches {
 
-extern const char kSbDisableAutoUpdate[];
 extern const char kSbDisableDownloadProtection[];
 extern const char kSbDisableExtensionBlacklist[];
 extern const char kSbManualDownloadBlacklist[];