forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wire up copy and move events to chromeos::FileChangeService.
This is part two of a series of CLs that will expose file change events to observers of a new browser context keyed service. In this CL, the new service is notified of copy and move events originating from Chrome OS specific file system operations which are created by the Chrome OS file system backend. This involved creation of a new chromeos::FileSystemOperation class serving as a thin extension to the default file system operation impl. This thin extension allows changes to storage// code to be minimal. Additional file change events will be wired up in a follow up CL following the same pattern. Design: http://shortn/_xrD1GHuIf1 Bug: 1136173 Change-Id: I9b906b309a1fd6b3d3f5b189c683ae6ffdd65f38 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2551636 Commit-Queue: David Black <dmblack@google.com> Reviewed-by: Toni Baržić <tbarzic@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Reviewed-by: Marijn Kruisselbrink <mek@chromium.org> Reviewed-by: Sergei Datsenko <dats@chromium.org> Cr-Commit-Position: refs/heads/master@{#835046}
- Loading branch information
David Black
authored and
Chromium LUCI CQ
committed
Dec 9, 2020
1 parent
708cc13
commit 8f8c1eb
Showing
15 changed files
with
531 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
chrome/browser/chromeos/fileapi/file_change_service_observer.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright 2020 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_FILEAPI_FILE_CHANGE_SERVICE_OBSERVER_H_ | ||
#define CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_CHANGE_SERVICE_OBSERVER_H_ | ||
|
||
#include "base/observer_list_types.h" | ||
|
||
namespace storage { | ||
class FileSystemURL; | ||
} // namespace storage | ||
|
||
namespace chromeos { | ||
|
||
// An interface for an observer which receives `FileChangeService` events. | ||
class FileChangeServiceObserver : public base::CheckedObserver { | ||
public: | ||
// Invoked when a file has been copied from `src` to `dst`. | ||
virtual void OnFileCopied(const storage::FileSystemURL& src, | ||
const storage::FileSystemURL& dst) {} | ||
|
||
// Invoked when a file has been moved from `src` to `dst`. | ||
virtual void OnFileMoved(const storage::FileSystemURL& src, | ||
const storage::FileSystemURL& dst) {} | ||
}; | ||
|
||
} // namespace chromeos | ||
|
||
#endif // CHROME_BROWSER_CHROMEOS_FILEAPI_FILE_CHANGE_SERVICE_OBSERVER_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.