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

Unified Diff: chrome/browser/chromeos/extensions/file_browser_private_api.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: Created 8 years, 5 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/extensions/file_browser_private_api.cc
diff --git a/chrome/browser/chromeos/extensions/file_browser_private_api.cc b/chrome/browser/chromeos/extensions/file_browser_private_api.cc
index 99dd321632bd39abd6adf71d4e2ba619edc1501b..e2aef629d05e758d74ba4f786e3b999671db08e8 100644
--- a/chrome/browser/chromeos/extensions/file_browser_private_api.cc
+++ b/chrome/browser/chromeos/extensions/file_browser_private_api.cc
@@ -1089,13 +1089,8 @@ bool AddMountFunction::RunImpl() {
break;
}
case chromeos::MOUNT_TYPE_GDATA: {
- gdata::GDataSystemService* system_service =
- gdata::GDataSystemServiceFactory::GetForProfile(profile_);
- if (system_service) {
- system_service->docs_service()->Authenticate(
- base::Bind(&AddMountFunction::OnGDataAuthentication,
- this));
- }
+ FileBrowserEventRouterFactory::GetForProfile(profile_)->
+ MountGData(base::Bind(&AddMountFunction::SendResponse, this));
break;
}
default: {
@@ -1114,33 +1109,6 @@ bool AddMountFunction::RunImpl() {
return true;
}
-void AddMountFunction::RaiseGDataMountEvent(gdata::GDataErrorCode error) {
- chromeos::MountError error_code = chromeos::MOUNT_ERROR_NONE;
- // For the file manager to work offline, GDATA_NO_CONNECTION is allowed.
- if (error == gdata::HTTP_SUCCESS || error == gdata::GDATA_NO_CONNECTION) {
- error_code = chromeos::MOUNT_ERROR_NONE;
- } else {
- error_code = chromeos::MOUNT_ERROR_NOT_AUTHENTICATED;
- }
- // Pass back the gdata mount point path as source path.
- const std::string& gdata_path = gdata::util::GetGDataMountPointPathAsString();
- SetResult(Value::CreateStringValue(gdata_path));
- DiskMountManager::MountPointInfo mount_info(
- gdata_path,
- gdata_path,
- chromeos::MOUNT_TYPE_GDATA,
- chromeos::disks::MOUNT_CONDITION_NONE);
- // Raise mount event
- FileBrowserEventRouterFactory::GetForProfile(profile_)->
- MountCompleted(DiskMountManager::MOUNTING, error_code, mount_info);
-}
-
-void AddMountFunction::OnGDataAuthentication(gdata::GDataErrorCode error,
- const std::string& token) {
- RaiseGDataMountEvent(error);
- SendResponse(true);
-}
-
void AddMountFunction::GetLocalPathsResponseOnUIThread(
const std::string& mount_type_str,
const SelectedFileInfoList& files) {

Powered by Google App Engine
This is Rietveld 408576698