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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_system_service.cc

Issue 10834115: Drive: Mount/Unmount GoogleDrive on Files App when the file system is mounted/unmounted. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: review fix Created 8 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/gdata/gdata_system_service.h" 5 #include "chrome/browser/chromeos/gdata/gdata_system_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/chromeos/gdata/drive_webapps_registry.h" 10 #include "chrome/browser/chromeos/gdata/drive_webapps_registry.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 return; 108 return;
109 109
110 const FilePath mount_point = gdata::util::GetGDataMountPointPath(); 110 const FilePath mount_point = gdata::util::GetGDataMountPointPath();
111 fileapi::ExternalFileSystemMountPointProvider* provider = 111 fileapi::ExternalFileSystemMountPointProvider* provider =
112 BrowserContext::GetFileSystemContext(profile_)->external_provider(); 112 BrowserContext::GetFileSystemContext(profile_)->external_provider();
113 if (provider && !provider->HasMountPoint(mount_point)) { 113 if (provider && !provider->HasMountPoint(mount_point)) {
114 provider->AddRemoteMountPoint( 114 provider->AddRemoteMountPoint(
115 mount_point, 115 mount_point,
116 new GDataFileSystemProxy(file_system_.get())); 116 new GDataFileSystemProxy(file_system_.get()));
117 } 117 }
118
119 file_system_->Initialize();
120 file_system_->NotifyFileSystemMounted();
118 } 121 }
119 122
120 void GDataSystemService::RemoveDriveMountPoint() { 123 void GDataSystemService::RemoveDriveMountPoint() {
124 file_system_->NotifyFileSystemToBeUnmounted();
125 file_system_->StopUpdates();
126
121 const FilePath mount_point = gdata::util::GetGDataMountPointPath(); 127 const FilePath mount_point = gdata::util::GetGDataMountPointPath();
122 fileapi::ExternalFileSystemMountPointProvider* provider = 128 fileapi::ExternalFileSystemMountPointProvider* provider =
123 BrowserContext::GetFileSystemContext(profile_)->external_provider(); 129 BrowserContext::GetFileSystemContext(profile_)->external_provider();
124 if (provider && provider->HasMountPoint(mount_point)) 130 if (provider && provider->HasMountPoint(mount_point))
125 provider->RemoveMountPoint(mount_point); 131 provider->RemoveMountPoint(mount_point);
126 } 132 }
127 133
128 //===================== GDataSystemServiceFactory ============================= 134 //===================== GDataSystemServiceFactory =============================
129 135
130 // static 136 // static
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 g_test_cache_root ? FilePath(*g_test_cache_root) : 190 g_test_cache_root ? FilePath(*g_test_cache_root) :
185 GDataCache::GetCacheRootPath(profile); 191 GDataCache::GetCacheRootPath(profile);
186 delete g_test_cache_root; 192 delete g_test_cache_root;
187 g_test_cache_root = NULL; 193 g_test_cache_root = NULL;
188 194
189 service->Initialize(documents_service, cache_root); 195 service->Initialize(documents_service, cache_root);
190 return service; 196 return service;
191 } 197 }
192 198
193 } // namespace gdata 199 } // namespace gdata
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698