Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2837)

Unified Diff: chrome/browser/chromeos/drive/drive_system_service.cc

Issue 13866050: drive: Introduce DriveSystemServiceObserver (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/drive/drive_system_service.cc
diff --git a/chrome/browser/chromeos/drive/drive_system_service.cc b/chrome/browser/chromeos/drive/drive_system_service.cc
index d61446516f7e1017c151c9424bdb42fcbd48d50f..a5095ff3753c892cceeba7aa4e6b0a4b5d54ea7a 100644
--- a/chrome/browser/chromeos/drive/drive_system_service.cc
+++ b/chrome/browser/chromeos/drive/drive_system_service.cc
@@ -191,6 +191,16 @@ void DriveSystemService::Shutdown() {
RemoveDriveMountPoint();
}
+void DriveSystemService::AddObserver(DriveSystemServiceObserver* observer) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ observers_.AddObserver(observer);
+}
+
+void DriveSystemService::RemoveObserver(DriveSystemServiceObserver* observer) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ observers_.RemoveObserver(observer);
+}
+
bool DriveSystemService::IsDriveEnabled() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -309,14 +319,16 @@ void DriveSystemService::AddDriveMountPoint() {
if (success) {
event_logger_->Log("AddDriveMountPoint");
- file_system_->NotifyFileSystemMounted();
+ FOR_EACH_OBSERVER(DriveSystemServiceObserver, observers_,
+ OnFileSystemMounted());
}
}
void DriveSystemService::RemoveDriveMountPoint() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- file_system_->NotifyFileSystemToBeUnmounted();
+ FOR_EACH_OBSERVER(DriveSystemServiceObserver, observers_,
+ OnFileSystemBeingUnmounted());
fileapi::ExternalMountPoints* mount_points =
BrowserContext::GetMountPoints(profile_);
« no previous file with comments | « chrome/browser/chromeos/drive/drive_system_service.h ('k') | chrome/browser/chromeos/drive/fake_drive_file_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698