Commit 6db03370 authored by Sam McNally's avatar Sam McNally Committed by Commit Bot

Send network online/offline state to DriveFS.

Bug: b:110464348
Change-Id: I356c9411d76cbbc5d0cad51a4aad65eadd600c6b
Reviewed-on: https://chromium-review.googlesource.com/1179118Reviewed-by: default avatarStuart Langley <slangley@chromium.org>
Commit-Queue: Sam McNally <sammc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583977}
parent d6bbb56c
...@@ -263,9 +263,10 @@ class DriveIntegrationService::PreferenceWatcher ...@@ -263,9 +263,10 @@ class DriveIntegrationService::PreferenceWatcher
if (!integration_service_->GetDriveFsInterface()) if (!integration_service_->GetDriveFsInterface())
return; return;
integration_service_->GetDriveFsInterface()->SetPauseSyncing( integration_service_->GetDriveFsInterface()->UpdateNetworkState(
net::NetworkChangeNotifier::IsConnectionCellular(type) && net::NetworkChangeNotifier::IsConnectionCellular(type) &&
pref_service_->GetBoolean(prefs::kDisableDriveOverCellular)); pref_service_->GetBoolean(prefs::kDisableDriveOverCellular),
type == net::NetworkChangeNotifier::CONNECTION_NONE);
} }
PrefService* pref_service_; PrefService* pref_service_;
......
...@@ -183,6 +183,6 @@ void FakeDriveFs::SetPinned(const base::FilePath& path, ...@@ -183,6 +183,6 @@ void FakeDriveFs::SetPinned(const base::FilePath& path,
std::move(callback).Run(drive::FILE_ERROR_OK); std::move(callback).Run(drive::FILE_ERROR_OK);
} }
void FakeDriveFs::SetPauseSyncing(bool pause) {} void FakeDriveFs::UpdateNetworkState(bool pause_syncing, bool is_offline) {}
} // namespace drivefs } // namespace drivefs
...@@ -53,7 +53,7 @@ class FakeDriveFs : public drivefs::mojom::DriveFs, ...@@ -53,7 +53,7 @@ class FakeDriveFs : public drivefs::mojom::DriveFs,
bool pinned, bool pinned,
SetPinnedCallback callback) override; SetPinnedCallback callback) override;
void SetPauseSyncing(bool pause) override; void UpdateNetworkState(bool pause_syncing, bool is_offline) override;
const base::FilePath mount_path_; const base::FilePath mount_path_;
......
...@@ -30,8 +30,9 @@ interface DriveFs { ...@@ -30,8 +30,9 @@ interface DriveFs {
// |pinned|. // |pinned|.
SetPinned(mojo_base.mojom.FilePath path, bool pinned) => (FileError error); SetPinned(mojo_base.mojom.FilePath path, bool pinned) => (FileError error);
// Set whether syncing should be paused. // Update DriveFS with the current network state, including whether the
SetPauseSyncing(bool pause); // network is available and whether syncing should be paused.
UpdateNetworkState(bool pause_syncing, bool is_offline);
}; };
// Implemented by Chrome, used from DriveFS. // Implemented by Chrome, used from DriveFS.
......
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