Index: chrome/browser/chromeos/extensions/file_browser_event_router.cc |
diff --git a/chrome/browser/chromeos/extensions/file_browser_event_router.cc b/chrome/browser/chromeos/extensions/file_browser_event_router.cc |
index c3479feb361e067385b3f48596832237c6bd1297..a5672061cbf0d9de767a804aa893a04b72bbde59 100644 |
--- a/chrome/browser/chromeos/extensions/file_browser_event_router.cc |
+++ b/chrome/browser/chromeos/extensions/file_browser_event_router.cc |
@@ -166,6 +166,11 @@ bool FileBrowserEventRouter::AddFileWatch( |
} else { |
iter->second->AddExtension(extension_id); |
} |
+ if (is_remote_watch) { |
+ gdata::GDataFileSystem* file_system = GetFileSystem(); |
satorux1
2012/05/03 19:41:34
Per your comment, we are not on UI thread here? If
hshi
2012/05/03 21:17:49
Done.
|
+ if (file_system) |
+ file_system->RequestStartUpdates(); |
satorux1
2012/05/03 19:44:54
I have another idea.
Wouldn't it be simpler just
satorux1
2012/05/03 19:47:41
I was assuming that FileBrowserEventRouter is crea
zel
2012/05/03 19:54:30
Lifetime of FileBrowserEventRouter is RefcountedPr
hshi
2012/05/03 21:17:49
I have moved this logic out to a separate task on
|
+ } |
return true; |
} |
@@ -179,6 +184,9 @@ void FileBrowserEventRouter::RemoveFileWatch( |
// their change notifications. |
if (gdata::util::GetSpecialRemoteRootPath().IsParent(watch_path)) { |
watch_path = gdata::util::ExtractGDataPath(watch_path); |
+ gdata::GDataFileSystem* file_system = GetFileSystem(); |
+ if (file_system) |
+ file_system->RequestStopUpdates(); |
} |
WatcherMap::iterator iter = file_watchers_.find(watch_path); |
if (iter == file_watchers_.end()) |
@@ -255,10 +263,7 @@ void FileBrowserEventRouter::MountCompleted( |
if ((event_type == DiskMountManager::MOUNTING) != |
(error_code == chromeos::MOUNT_ERROR_NONE)) { |
FilePath source_path(mount_info.source_path); |
- gdata::GDataSystemService* system_service = |
- gdata::GDataSystemServiceFactory::GetForProfile(profile_); |
- gdata::GDataFileSystem* file_system = |
- system_service ? system_service->file_system() : NULL; |
+ gdata::GDataFileSystem* file_system = GetFileSystem(); |
if (file_system && file_system->IsUnderGDataCacheDirectory(source_path)) |
file_system->SetMountedState(source_path, false, |
gdata::SetMountedStateCallback()); |
@@ -601,6 +606,12 @@ FileBrowserEventRouter::FileWatcherExtensions::GetVirtualPath() const { |
return virtual_path_; |
} |
+gdata::GDataFileSystem* FileBrowserEventRouter::GetFileSystem() const { |
+ gdata::GDataSystemService* system_service = |
+ gdata::GDataSystemServiceFactory::GetForProfile(profile_); |
+ return (system_service ? system_service->file_system() : NULL); |
+} |
+ |
bool FileBrowserEventRouter::FileWatcherExtensions::Watch |
(const FilePath& path, FileWatcherDelegate* delegate) { |
if (is_remote_file_system_) |