Move PathIsWritable, DirectoryExists, ContentsEqual, and TextContentsEqual to the base namespace.

TBR=sky

Review URL: https://codereview.chromium.org/19052005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211675 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/browser_encoding_browsertest.cc b/chrome/browser/browser_encoding_browsertest.cc
index 976c4b1..e4911db 100644
--- a/chrome/browser/browser_encoding_browsertest.cc
+++ b/chrome/browser/browser_encoding_browsertest.cc
@@ -133,7 +133,7 @@
     base::FilePath expected_file_name = ui_test_utils::GetTestFilePath(
         base::FilePath(kTestDir), expected);
 
-    EXPECT_TRUE(file_util::ContentsEqual(full_file_name, expected_file_name));
+    EXPECT_TRUE(base::ContentsEqual(full_file_name, expected_file_name));
   }
 
   virtual void SetUpOnMainThread() OVERRIDE {
diff --git a/chrome/browser/chromeos/extensions/file_manager/file_manager_event_router.cc b/chrome/browser/chromeos/extensions/file_manager/file_manager_event_router.cc
index b5a66ff3..1237226 100644
--- a/chrome/browser/chromeos/extensions/file_manager/file_manager_event_router.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/file_manager_event_router.cc
@@ -99,7 +99,7 @@
                                    const base::Closure& failure_callback) {
   DCHECK(BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread());
 
-  if (file_util::DirectoryExists(directory_path))
+  if (base::DirectoryExists(directory_path))
     BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, success_callback);
   else
     BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, failure_callback);
diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
index c1c3000..1d79a69 100644
--- a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
+++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
@@ -77,7 +77,7 @@
 bool SaveData(int key, const std::string& file_name, const std::string& data) {
   base::FilePath data_dir;
   CHECK(PathService::Get(key, &data_dir));
-  if (!file_util::DirectoryExists(data_dir) &&
+  if (!base::DirectoryExists(data_dir) &&
       !file_util::CreateDirectory(data_dir)) {
     return false;
   }
@@ -94,7 +94,7 @@
 // expected that we may try to access file which did not saved yet.
 bool GetData(const base::FilePath& path, std::string* data) {
   base::FilePath data_dir = path.DirName();
-  if (!file_util::DirectoryExists(data_dir) &&
+  if (!base::DirectoryExists(data_dir) &&
       !file_util::CreateDirectory(data_dir))
     return false;
 
@@ -893,7 +893,7 @@
   if (source == kOnlineSource) {
     base::FilePath wallpaper_dir;
     CHECK(PathService::Get(chrome::DIR_CHROMEOS_WALLPAPERS, &wallpaper_dir));
-    if (file_util::DirectoryExists(wallpaper_dir)) {
+    if (base::DirectoryExists(wallpaper_dir)) {
       base::FileEnumerator files(wallpaper_dir, false,
                                  base::FileEnumerator::FILES);
       for (base::FilePath current = files.Next(); !current.empty();
diff --git a/chrome/browser/chromeos/login/wallpaper_manager.cc b/chrome/browser/chromeos/login/wallpaper_manager.cc
index ff14a87..d5a7bbf7 100644
--- a/chrome/browser/chromeos/login/wallpaper_manager.cc
+++ b/chrome/browser/chromeos/login/wallpaper_manager.cc
@@ -671,7 +671,7 @@
 
 void WallpaperManager::DeleteAllExcept(const base::FilePath& path) {
   base::FilePath dir = path.DirName();
-  if (file_util::DirectoryExists(dir)) {
+  if (base::DirectoryExists(dir)) {
     base::FileEnumerator files(dir, false, base::FileEnumerator::FILES);
     for (base::FilePath current = files.Next(); !current.empty();
          current = files.Next()) {
diff --git a/chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc b/chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc
index 77833c01..0a5b6262 100644
--- a/chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc
+++ b/chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc
@@ -94,7 +94,7 @@
                                         const std::string& id) {
     base::FilePath wallpaper_path =
         WallpaperManager::Get()->GetCustomWallpaperPath(sub_dir, email, id);
-    if (!file_util::DirectoryExists(wallpaper_path.DirName()))
+    if (!base::DirectoryExists(wallpaper_path.DirName()))
       file_util::CreateDirectory(wallpaper_path.DirName());
 
     return wallpaper_path;
diff --git a/chrome/browser/chromeos/policy/app_pack_updater.cc b/chrome/browser/chromeos/policy/app_pack_updater.cc
index b020e86..feb5950 100644
--- a/chrome/browser/chromeos/policy/app_pack_updater.cc
+++ b/chrome/browser/chromeos/policy/app_pack_updater.cc
@@ -240,7 +240,7 @@
     CacheEntryMap* entries) {
   // Start by verifying that the cache dir exists.
   base::FilePath dir(kAppPackCacheDir);
-  if (!file_util::DirectoryExists(dir)) {
+  if (!base::DirectoryExists(dir)) {
     // Create it now.
     if (!file_util::CreateDirectory(dir))
       LOG(ERROR) << "Failed to create AppPack directory at " << dir.value();
@@ -484,7 +484,7 @@
     base::Delete(cached_crx_path, true /* recursive */);
   }
 
-  if (!file_util::DirectoryExists(cache_dir)) {
+  if (!base::DirectoryExists(cache_dir)) {
     LOG(ERROR) << "AppPack cache directory does not exist, creating now: "
                << cache_dir.value();
     if (!file_util::CreateDirectory(cache_dir)) {
diff --git a/chrome/browser/component_updater/component_patcher_operation.cc b/chrome/browser/component_updater/component_patcher_operation.cc
index ba849189..3f5f46a 100644
--- a/chrome/browser/component_updater/component_patcher_operation.cc
+++ b/chrome/browser/component_updater/component_patcher_operation.cc
@@ -72,7 +72,7 @@
     return parse_result;
 
   const base::FilePath parent = output_abs_path_.DirName();
-  if (!file_util::DirectoryExists(parent)) {
+  if (!base::DirectoryExists(parent)) {
     if (!file_util::CreateDirectory(parent))
       return ComponentUnpacker::kIoError;
   }
diff --git a/chrome/browser/component_updater/test/component_patcher_unittest.cc b/chrome/browser/component_updater/test/component_patcher_unittest.cc
index f9933b3..f121fc0b 100644
--- a/chrome/browser/component_updater/test/component_patcher_unittest.cc
+++ b/chrome/browser/component_updater/test/component_patcher_unittest.cc
@@ -85,7 +85,7 @@
 
   EXPECT_EQ(ComponentUnpacker::kNone, result);
   EXPECT_EQ(0, error);
-  EXPECT_TRUE(file_util::ContentsEqual(
+  EXPECT_TRUE(base::ContentsEqual(
       unpack_dir_.path().Append(FILE_PATH_LITERAL("output.bin")),
       test_file("binary_output.bin")));
 }
@@ -112,7 +112,7 @@
                                      &error);
   EXPECT_EQ(ComponentUnpacker::kNone, result);
   EXPECT_EQ(0, error);
-  EXPECT_TRUE(file_util::ContentsEqual(
+  EXPECT_TRUE(base::ContentsEqual(
       unpack_dir_.path().Append(FILE_PATH_LITERAL("output.bin")),
       test_file("binary_output.bin")));
 }
diff --git a/chrome/browser/component_updater/test/component_patcher_unittest_win.cc b/chrome/browser/component_updater/test/component_patcher_unittest_win.cc
index 9787d92..afec59d 100644
--- a/chrome/browser/component_updater/test/component_patcher_unittest_win.cc
+++ b/chrome/browser/component_updater/test/component_patcher_unittest_win.cc
@@ -46,7 +46,7 @@
                                      &error);
   EXPECT_EQ(ComponentUnpacker::kNone, result);
   EXPECT_EQ(0, error);
-  EXPECT_TRUE(file_util::ContentsEqual(
+  EXPECT_TRUE(base::ContentsEqual(
       unpack_dir_.path().Append(FILE_PATH_LITERAL("output.bin")),
       test_file("binary_output.bin")));
 }
@@ -77,7 +77,7 @@
                                      &error);
   EXPECT_EQ(ComponentUnpacker::kNone, result);
   EXPECT_EQ(0, error);
-  EXPECT_TRUE(file_util::ContentsEqual(
+  EXPECT_TRUE(base::ContentsEqual(
       unpack_dir_.path().Append(FILE_PATH_LITERAL("output.bin")),
       test_file("binary_output.bin")));
 }
diff --git a/chrome/browser/diagnostics/recon_diagnostics.cc b/chrome/browser/diagnostics/recon_diagnostics.cc
index f2043e5..059d6fc 100644
--- a/chrome/browser/diagnostics/recon_diagnostics.cc
+++ b/chrome/browser/diagnostics/recon_diagnostics.cc
@@ -278,7 +278,7 @@
       RecordSuccess("Path exists");
       return true;
     }
-    if (!file_util::PathIsWritable(dir_or_file)) {
+    if (!base::PathIsWritable(dir_or_file)) {
       RecordFailure(DIAG_RECON_NOT_WRITABLE,
                     "Path is not writable: " +
                         UTF16ToUTF8(dir_or_file.LossyDisplayName()));
diff --git a/chrome/browser/download/download_path_reservation_tracker.cc b/chrome/browser/download/download_path_reservation_tracker.cc
index d241649..37954a30 100644
--- a/chrome/browser/download/download_path_reservation_tracker.cc
+++ b/chrome/browser/download/download_path_reservation_tracker.cc
@@ -180,7 +180,7 @@
   // since been removed, do NOT automatically re-create it. Only automatically
   // create the directory if it is the default Downloads directory or if the
   // caller explicitly requested automatic directory creation.
-  if (!file_util::DirectoryExists(target_dir) &&
+  if (!base::DirectoryExists(target_dir) &&
       (create_directory ||
        (!default_download_path.empty() &&
         (default_download_path == target_dir)))) {
@@ -189,7 +189,7 @@
 
   // Check writability of the suggested path. If we can't write to it, default
   // to the user's "My Documents" directory. We'll prompt them in this case.
-  if (!file_util::PathIsWritable(target_dir)) {
+  if (!base::PathIsWritable(target_dir)) {
     DVLOG(1) << "Unable to write to directory \"" << target_dir.value() << "\"";
     is_path_writeable = false;
     PathService::Get(chrome::DIR_USER_DOCUMENTS, &target_dir);
diff --git a/chrome/browser/download/download_path_reservation_tracker_unittest.cc b/chrome/browser/download/download_path_reservation_tracker_unittest.cc
index 67a3dfbb..6ac7b45 100644
--- a/chrome/browser/download/download_path_reservation_tracker_unittest.cc
+++ b/chrome/browser/download/download_path_reservation_tracker_unittest.cc
@@ -500,7 +500,7 @@
   base::FilePath path(
       GetPathInDownloadsDirectory(FILE_PATH_LITERAL("foo/foo.txt")));
   base::FilePath dir(path.DirName());
-  ASSERT_FALSE(file_util::DirectoryExists(dir));
+  ASSERT_FALSE(base::DirectoryExists(dir));
   DownloadPathReservationTracker::FilenameConflictAction conflict_action =
     DownloadPathReservationTracker::OVERWRITE;
   bool create_directory = false;
@@ -535,7 +535,7 @@
         &verified);
     // Verification succeeds because the directory is created.
     EXPECT_TRUE(verified);
-    EXPECT_TRUE(file_util::DirectoryExists(dir));
+    EXPECT_TRUE(base::DirectoryExists(dir));
     item->SetState(DownloadItem::COMPLETE);
   }
 }
diff --git a/chrome/browser/download/save_page_browsertest.cc b/chrome/browser/download/save_page_browsertest.cc
index 9378f06..afaef69 100644
--- a/chrome/browser/download/save_page_browsertest.cc
+++ b/chrome/browser/download/save_page_browsertest.cc
@@ -403,7 +403,7 @@
   EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible());
   EXPECT_TRUE(base::PathExists(full_file_name));
   EXPECT_FALSE(base::PathExists(dir));
-  EXPECT_TRUE(file_util::ContentsEqual(test_dir_.Append(base::FilePath(
+  EXPECT_TRUE(base::ContentsEqual(test_dir_.Append(base::FilePath(
       kTestDir)).Append(FILE_PATH_LITERAL("a.htm")), full_file_name));
 }
 
@@ -527,7 +527,7 @@
 
   EXPECT_TRUE(base::PathExists(full_file_name));
   EXPECT_FALSE(base::PathExists(dir));
-  EXPECT_TRUE(file_util::ContentsEqual(
+  EXPECT_TRUE(base::ContentsEqual(
       test_dir_.Append(base::FilePath(kTestDir)).Append(file_name),
       full_file_name));
 }
@@ -562,13 +562,13 @@
 
   EXPECT_TRUE(base::PathExists(full_file_name));
   EXPECT_TRUE(base::PathExists(dir));
-  EXPECT_TRUE(file_util::TextContentsEqual(
+  EXPECT_TRUE(base::TextContentsEqual(
       test_dir_.Append(base::FilePath(kTestDir)).AppendASCII("b.saved1.htm"),
       full_file_name));
-  EXPECT_TRUE(file_util::ContentsEqual(
+  EXPECT_TRUE(base::ContentsEqual(
       test_dir_.Append(base::FilePath(kTestDir)).AppendASCII("1.png"),
       dir.AppendASCII("1.png")));
-  EXPECT_TRUE(file_util::ContentsEqual(
+  EXPECT_TRUE(base::ContentsEqual(
       test_dir_.Append(base::FilePath(kTestDir)).AppendASCII("1.css"),
       dir.AppendASCII("1.css")));
 }
@@ -660,13 +660,13 @@
 
   EXPECT_TRUE(base::PathExists(full_file_name));
   EXPECT_TRUE(base::PathExists(dir));
-  EXPECT_TRUE(file_util::TextContentsEqual(
+  EXPECT_TRUE(base::TextContentsEqual(
       test_dir_.Append(base::FilePath(kTestDir)).AppendASCII("b.saved2.htm"),
       full_file_name));
-  EXPECT_TRUE(file_util::ContentsEqual(
+  EXPECT_TRUE(base::ContentsEqual(
       test_dir_.Append(base::FilePath(kTestDir)).AppendASCII("1.png"),
       dir.AppendASCII("1.png")));
-  EXPECT_TRUE(file_util::ContentsEqual(
+  EXPECT_TRUE(base::ContentsEqual(
       test_dir_.Append(base::FilePath(kTestDir)).AppendASCII("1.css"),
       dir.AppendASCII("1.css")));
 }
@@ -712,7 +712,7 @@
 
   EXPECT_TRUE(base::PathExists(full_file_name));
   EXPECT_FALSE(base::PathExists(dir));
-  EXPECT_TRUE(file_util::ContentsEqual(test_dir_.Append(base::FilePath(
+  EXPECT_TRUE(base::ContentsEqual(test_dir_.Append(base::FilePath(
       kTestDir)).Append(FILE_PATH_LITERAL("a.htm")), full_file_name));
 }
 
diff --git a/chrome/browser/extensions/api/file_system/file_system_api.cc b/chrome/browser/extensions/api/file_system/file_system_api.cc
index 0e6cd76..c02d5e01 100644
--- a/chrome/browser/extensions/api/file_system/file_system_api.cc
+++ b/chrome/browser/extensions/api/file_system/file_system_api.cc
@@ -658,7 +658,7 @@
     const base::FilePath& suggested_name,
     const base::FilePath& previous_path) {
   DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
-  if (!previous_path.empty() && file_util::DirectoryExists(previous_path)) {
+  if (!previous_path.empty() && base::DirectoryExists(previous_path)) {
     initial_path_ = previous_path.Append(suggested_name);
   } else {
     base::FilePath documents_dir;
diff --git a/chrome/browser/extensions/api/record/record_api_test.cc b/chrome/browser/extensions/api/record/record_api_test.cc
index dfcda5d..3fd41d9 100644
--- a/chrome/browser/extensions/api/record/record_api_test.cc
+++ b/chrome/browser/extensions/api/record/record_api_test.cc
@@ -106,13 +106,13 @@
         if (command_line.HasSwitch(switches::kRecordMode)) {
           base::CopyFile(url_path, url_path_copy);
         } else {
-          if (!file_util::ContentsEqual(url_path, url_path_copy)) {
+          if (!base::ContentsEqual(url_path, url_path_copy)) {
             std::string contents1, contents2;
             file_util::ReadFileToString(url_path, &contents1);
             file_util::ReadFileToString(url_path_copy, &contents2);
             LOG(ERROR) << "FILE MISMATCH" << contents1 << " VS " << contents2;
           }
-          EXPECT_TRUE(file_util::ContentsEqual(url_path, url_path_copy));
+          EXPECT_TRUE(base::ContentsEqual(url_path, url_path_copy));
         }
       }
 
diff --git a/chrome/browser/extensions/api/storage/managed_value_store_cache.cc b/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
index a64fc19..6184cfc 100644
--- a/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
+++ b/chrome/browser/extensions/api/storage/managed_value_store_cache.cc
@@ -235,7 +235,7 @@
     // (because the extension is unloaded, for example). Open the database to
     // clear it if it exists.
     // TODO(joaodasilva): move this check to a ValueStore method.
-    if (file_util::DirectoryExists(base_path_.AppendASCII(extension_id))) {
+    if (base::DirectoryExists(base_path_.AppendASCII(extension_id))) {
       CreateStoreFor(
           extension_id,
           false,
@@ -383,7 +383,7 @@
     // If the database doesn't exist yet then this is the initial install,
     // and no notifications should be issued in that case.
     // TODO(joaodasilva): move this check to a ValueStore method.
-    if (!file_util::DirectoryExists(base_path_.AppendASCII(extension_id)))
+    if (!base::DirectoryExists(base_path_.AppendASCII(extension_id)))
       notify_if_changed = false;
 
     store = new PolicyValueStore(
diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
index 92d8cca..3e3fe78 100644
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
@@ -198,7 +198,7 @@
   ASSERT_TRUE(RunInstallTest("accepted.html", "extension.crx"));
 
   // Cleanup.
-  if (file_util::DirectoryExists(missing_directory))
+  if (base::DirectoryExists(missing_directory))
     EXPECT_TRUE(base::Delete(missing_directory, true));
 }
 
diff --git a/chrome/browser/extensions/extension_creator.cc b/chrome/browser/extensions/extension_creator.cc
index 975cd6d32..0784fee 100644
--- a/chrome/browser/extensions/extension_creator.cc
+++ b/chrome/browser/extensions/extension_creator.cc
@@ -41,7 +41,7 @@
     int run_flags) {
   // Validate input |extension_dir|.
   if (extension_dir.value().empty() ||
-      !file_util::DirectoryExists(extension_dir)) {
+      !base::DirectoryExists(extension_dir)) {
     error_message_ =
         l10n_util::GetStringUTF8(IDS_EXTENSION_DIRECTORY_NO_EXISTS);
     return false;
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index 2541e0a5..5121e67e 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -4072,7 +4072,7 @@
       base::MessageLoop::current()->message_loop_proxy().get());
   base::FilePath idb_path = idb_context->GetFilePathForTesting(origin_id);
   EXPECT_TRUE(file_util::CreateDirectory(idb_path));
-  EXPECT_TRUE(file_util::DirectoryExists(idb_path));
+  EXPECT_TRUE(base::DirectoryExists(idb_path));
 
   // Uninstall the extension.
   service_->UninstallExtension(good_crx, false, NULL);
@@ -4095,7 +4095,7 @@
   EXPECT_FALSE(base::PathExists(lso_file_path));
 
   // Check if the indexed db has disappeared too.
-  EXPECT_FALSE(file_util::DirectoryExists(idb_path));
+  EXPECT_FALSE(base::DirectoryExists(idb_path));
 }
 
 // Verifies app state is removed upon uninstall.
@@ -4189,7 +4189,7 @@
       base::MessageLoop::current()->message_loop_proxy().get());
   base::FilePath idb_path = idb_context->GetFilePathForTesting(origin_id);
   EXPECT_TRUE(file_util::CreateDirectory(idb_path));
-  EXPECT_TRUE(file_util::DirectoryExists(idb_path));
+  EXPECT_TRUE(base::DirectoryExists(idb_path));
 
   // Uninstall one of them, unlimited storage should still be granted
   // to the origin.
@@ -4229,7 +4229,7 @@
   EXPECT_FALSE(base::PathExists(lso_file_path));
 
   // Check if the indexed db has disappeared too.
-  EXPECT_FALSE(file_util::DirectoryExists(idb_path));
+  EXPECT_FALSE(base::DirectoryExists(idb_path));
 }
 
 // Tests loading single extensions (like --load-extension)
diff --git a/chrome/browser/extensions/platform_app_launcher.cc b/chrome/browser/extensions/platform_app_launcher.cc
index c6c862cb..66d1133 100644
--- a/chrome/browser/extensions/platform_app_launcher.cc
+++ b/chrome/browser/extensions/platform_app_launcher.cc
@@ -147,7 +147,7 @@
 
     // If the file doesn't exist, or is a directory, launch with no launch data.
     if (!base::PathExists(file_path_) ||
-        file_util::DirectoryExists(file_path_)) {
+        base::DirectoryExists(file_path_)) {
       LOG(WARNING) << "No file exists with path " << file_path_.value();
       BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind(
               &PlatformAppPathLauncher::LaunchWithNoLaunchData, this));
diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc
index 2b14cf53..44b6450c 100644
--- a/chrome/browser/extensions/webstore_installer.cc
+++ b/chrome/browser/extensions/webstore_installer.cc
@@ -88,7 +88,7 @@
 
   // Ensure the download directory exists. TODO(asargent) - make this use
   // common code from the downloads system.
-  if (!file_util::DirectoryExists(directory)) {
+  if (!base::DirectoryExists(directory)) {
     if (!file_util::CreateDirectory(directory)) {
       BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
                               base::Bind(callback, base::FilePath()));
diff --git a/chrome/browser/google/google_update_settings_posix.cc b/chrome/browser/google/google_update_settings_posix.cc
index c253421..4da917a 100644
--- a/chrome/browser/google/google_update_settings_posix.cc
+++ b/chrome/browser/google/google_update_settings_posix.cc
@@ -37,7 +37,7 @@
 bool GoogleUpdateSettings::SetCollectStatsConsent(bool consented) {
   base::FilePath consent_dir;
   PathService::Get(chrome::DIR_USER_DATA, &consent_dir);
-  if (!file_util::DirectoryExists(consent_dir))
+  if (!base::DirectoryExists(consent_dir))
     return false;
 
   base::FilePath consent_file = consent_dir.AppendASCII(kConsentToSendStats);
@@ -60,7 +60,7 @@
   // Make sure that user has consented to send crashes.
   base::FilePath consent_dir;
   PathService::Get(chrome::DIR_USER_DATA, &consent_dir);
-  if (!file_util::DirectoryExists(consent_dir) ||
+  if (!base::DirectoryExists(consent_dir) ||
       !GoogleUpdateSettings::GetCollectStatsConsent())
     return false;
 
diff --git a/chrome/browser/importer/firefox3_importer.cc b/chrome/browser/importer/firefox3_importer.cc
index 50a0d0c..7a5c26a 100644
--- a/chrome/browser/importer/firefox3_importer.cc
+++ b/chrome/browser/importer/firefox3_importer.cc
@@ -431,9 +431,9 @@
   DCHECK(!locale_.empty());
   base::FilePath locale_app_path = app_path.AppendASCII(locale_);
   base::FilePath default_locale_app_path = app_path.AppendASCII("en-US");
-  if (file_util::DirectoryExists(locale_app_path))
+  if (base::DirectoryExists(locale_app_path))
     app_path = locale_app_path;
-  else if (file_util::DirectoryExists(default_locale_app_path))
+  else if (base::DirectoryExists(default_locale_app_path))
     app_path = default_locale_app_path;
 #endif
 
diff --git a/chrome/browser/media_galleries/fileapi/picasa/picasa_finder.cc b/chrome/browser/media_galleries/fileapi/picasa/picasa_finder.cc
index 6a0a657..400eef1 100644
--- a/chrome/browser/media_galleries/fileapi/picasa/picasa_finder.cc
+++ b/chrome/browser/media_galleries/fileapi/picasa/picasa_finder.cc
@@ -36,7 +36,7 @@
   path = path.AppendASCII("Google").AppendASCII("Picasa2").AppendASCII("db3");
 
   // Verify actual existence
-  if (!file_util::DirectoryExists(path))
+  if (!base::DirectoryExists(path))
     path.clear();
 
   return path;
diff --git a/chrome/browser/page_cycler/page_cycler_unittest.cc b/chrome/browser/page_cycler/page_cycler_unittest.cc
index eef3eb8c..cbfc07e 100644
--- a/chrome/browser/page_cycler/page_cycler_unittest.cc
+++ b/chrome/browser/page_cycler/page_cycler_unittest.cc
@@ -29,7 +29,7 @@
 using content::RenderViewHost;
 using content::TestBrowserThread;
 using content::WebContentsObserver;
-using file_util::ContentsEqual;
+using base::ContentsEqual;
 using base::PathExists;
 
 namespace {
diff --git a/chrome/browser/performance_monitor/database.cc b/chrome/browser/performance_monitor/database.cc
index 36bc93c9..c08c2b8 100644
--- a/chrome/browser/performance_monitor/database.cc
+++ b/chrome/browser/performance_monitor/database.cc
@@ -91,7 +91,7 @@
     path = path.AppendASCII(kDbDir);
   }
   scoped_ptr<Database> database;
-  if (!file_util::DirectoryExists(path) && !file_util::CreateDirectory(path))
+  if (!base::DirectoryExists(path) && !file_util::CreateDirectory(path))
     return database.Pass();
   database.reset(new Database(path));
 
diff --git a/chrome/browser/platform_util_linux.cc b/chrome/browser/platform_util_linux.cc
index 9ac22d79..6f88b16 100644
--- a/chrome/browser/platform_util_linux.cc
+++ b/chrome/browser/platform_util_linux.cc
@@ -56,7 +56,7 @@
 // show the folder.
 void ShowItemInFolderOnFileThread(const base::FilePath& full_path) {
   base::FilePath dir = full_path.DirName();
-  if (!file_util::DirectoryExists(dir))
+  if (!base::DirectoryExists(dir))
     return;
 
   XDGOpen(dir.value());
diff --git a/chrome/browser/policy/cloud/resource_cache.cc b/chrome/browser/policy/cloud/resource_cache.cc
index 2214a2e4c..82aea6d 100644
--- a/chrome/browser/policy/cloud/resource_cache.cc
+++ b/chrome/browser/policy/cloud/resource_cache.cc
@@ -154,7 +154,7 @@
     return false;
   *path = cache_dir_.AppendASCII(encoded);
   return allow_create ? file_util::CreateDirectory(*path) :
-                        file_util::DirectoryExists(*path);
+                        base::DirectoryExists(*path);
 }
 
 bool ResourceCache::VerifyKeyPathAndGetSubkeyPath(const std::string& key,
diff --git a/chrome/browser/prefs/chrome_pref_service_unittest.cc b/chrome/browser/prefs/chrome_pref_service_unittest.cc
index 683ffa5..39d97863 100644
--- a/chrome/browser/prefs/chrome_pref_service_unittest.cc
+++ b/chrome/browser/prefs/chrome_pref_service_unittest.cc
@@ -138,7 +138,7 @@
   base::FilePath golden_output_file =
       data_dir_.AppendASCII("write.golden.need_empty_value.json");
   ASSERT_TRUE(base::PathExists(golden_output_file));
-  EXPECT_TRUE(file_util::TextContentsEqual(golden_output_file, pref_file));
+  EXPECT_TRUE(base::TextContentsEqual(golden_output_file, pref_file));
 }
 
 class ChromePrefServiceWebKitPrefs : public ChromeRenderViewHostTestHarness {
diff --git a/chrome/browser/profiles/profile_info_cache.cc b/chrome/browser/profiles/profile_info_cache.cc
index 9434b5a..94e4c47 100644
--- a/chrome/browser/profiles/profile_info_cache.cc
+++ b/chrome/browser/profiles/profile_info_cache.cc
@@ -122,7 +122,7 @@
 
   // Make sure the destination directory exists.
   base::FilePath dir = image_path.DirName();
-  if (!file_util::DirectoryExists(dir) && !file_util::CreateDirectory(dir)) {
+  if (!base::DirectoryExists(dir) && !file_util::CreateDirectory(dir)) {
     LOG(ERROR) << "Failed to create parent directory.";
     return;
   }
diff --git a/chrome/browser/search_engines/template_url_fetcher_unittest.cc b/chrome/browser/search_engines/template_url_fetcher_unittest.cc
index 5e8dffe..d97e662 100644
--- a/chrome/browser/search_engines/template_url_fetcher_unittest.cc
+++ b/chrome/browser/search_engines/template_url_fetcher_unittest.cc
@@ -146,7 +146,7 @@
     ASSERT_TRUE(PathService::Get(chrome::DIR_TEST_DATA, &osdd_full_path));
     osdd_full_path = osdd_full_path.AppendASCII(osdd_file_name);
     ASSERT_TRUE(base::PathExists(osdd_full_path));
-    ASSERT_FALSE(file_util::DirectoryExists(osdd_full_path));
+    ASSERT_FALSE(base::DirectoryExists(osdd_full_path));
   }
 
   // Start the fetch.
diff --git a/chrome/browser/storage_monitor/media_storage_util.cc b/chrome/browser/storage_monitor/media_storage_util.cc
index 76d39f7..aef5b0b 100644
--- a/chrome/browser/storage_monitor/media_storage_util.cc
+++ b/chrome/browser/storage_monitor/media_storage_util.cc
@@ -103,11 +103,11 @@
   DCHECK(!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
 
   base::FilePath::StringType dcim_dir(kDCIMDirectoryName);
-  if (!file_util::DirectoryExists(mount_point.Append(dcim_dir))) {
+  if (!base::DirectoryExists(mount_point.Append(dcim_dir))) {
     // Check for lowercase 'dcim' as well.
     base::FilePath dcim_path_lower(
         mount_point.Append(StringToLowerASCII(dcim_dir)));
-    if (!file_util::DirectoryExists(dcim_path_lower))
+    if (!base::DirectoryExists(dcim_path_lower))
       return false;
   }
   return true;
diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc
index e1186a53..d53f7cce 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -1394,7 +1394,7 @@
 
 void SyncBackendHost::Core::DeleteSyncDataFolder() {
   DCHECK_EQ(base::MessageLoop::current(), sync_loop_);
-  if (file_util::DirectoryExists(sync_data_folder_path_)) {
+  if (base::DirectoryExists(sync_data_folder_path_)) {
     if (!base::Delete(sync_data_folder_path_, true))
       SLOG(DFATAL) << "Could not delete the Sync Data folder.";
   }
diff --git a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl.cc b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl.cc
index c3e5e9b..450f2b4 100644
--- a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl.cc
+++ b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl.cc
@@ -90,7 +90,7 @@
 bool SelectFileDialogImpl::CallDirectoryExistsOnUIThread(
     const base::FilePath& path) {
   base::ThreadRestrictions::ScopedAllowIO allow_io;
-  return file_util::DirectoryExists(path);
+  return base::DirectoryExists(path);
 }
 
 }  // namespace libgtk2ui
diff --git a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl.h b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl.h
index 55f1c300..89db17c 100644
--- a/chrome/browser/ui/libgtk2ui/select_file_dialog_impl.h
+++ b/chrome/browser/ui/libgtk2ui/select_file_dialog_impl.h
@@ -59,7 +59,7 @@
       gfx::NativeWindow owning_window,
       void* params) = 0;
 
-  // Wrapper for file_util::DirectoryExists() that allow access on the UI
+  // Wrapper for base::DirectoryExists() that allow access on the UI
   // thread. Use this only in the file dialog functions, where it's ok
   // because the file dialog has to do many stats anyway. One more won't
   // hurt too badly and it's likely already cached.
diff --git a/chrome/browser/ui/metro_pin_tab_helper_win.cc b/chrome/browser/ui/metro_pin_tab_helper_win.cc
index 6dca58f..aa0f1d8b 100644
--- a/chrome/browser/ui/metro_pin_tab_helper_win.cc
+++ b/chrome/browser/ui/metro_pin_tab_helper_win.cc
@@ -57,7 +57,7 @@
     return base::FilePath();
 
   tile_images_dir = tile_images_dir.Append(L"TileImages");
-  if (!file_util::DirectoryExists(tile_images_dir) &&
+  if (!base::DirectoryExists(tile_images_dir) &&
       !file_util::CreateDirectory(tile_images_dir))
     return base::FilePath();
 
diff --git a/chrome/browser/user_style_sheet_watcher.cc b/chrome/browser/user_style_sheet_watcher.cc
index ddf2ba6..2dd6414 100644
--- a/chrome/browser/user_style_sheet_watcher.cc
+++ b/chrome/browser/user_style_sheet_watcher.cc
@@ -104,7 +104,7 @@
   // We keep the user style sheet in a subdir so we can watch for changes
   // to the file.
   base::FilePath style_sheet_dir = style_sheet_file.DirName();
-  if (!file_util::DirectoryExists(style_sheet_dir)) {
+  if (!base::DirectoryExists(style_sheet_dir)) {
     if (!file_util::CreateDirectory(style_sheet_dir))
       return;
   }
diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm
index cda4da67..e731611 100644
--- a/chrome/browser/web_applications/web_app_mac.mm
+++ b/chrome/browser/web_applications/web_app_mac.mm
@@ -130,7 +130,7 @@
 base::FilePath GetWritableApplicationsDirectory() {
   base::FilePath path;
   if (base::mac::GetLocalDirectory(NSApplicationDirectory, &path) &&
-      file_util::PathIsWritable(path)) {
+      base::PathIsWritable(path)) {
     return path;
   }
   if (base::mac::GetUserDirectory(NSApplicationDirectory, &path))
@@ -384,7 +384,7 @@
 
 bool WebAppShortcutCreator::CreateShortcuts() {
   base::FilePath dst_path = GetDestinationPath();
-  if (dst_path.empty() || !file_util::DirectoryExists(dst_path.DirName())) {
+  if (dst_path.empty() || !base::DirectoryExists(dst_path.DirName())) {
     LOG(ERROR) << "Couldn't find an Applications directory to copy app to.";
     return false;
   }