| 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..4dac80630f1274a9d6a636449c66a67257d22561 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();
|
| + if (file_system)
|
| + file_system->StartUpdates();
|
| + }
|
| 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->StopUpdates();
|
| }
|
| 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_)
|
|
|