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

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: Remove unused methods in mock_gdata_file_system.h 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 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 c52d35102109abd52c973e15721189a0a5101252..2a7779c21a1f4e7b3d54eaa5ff2aa535692fe8b5 100644
--- a/chrome/browser/chromeos/extensions/file_browser_private_api.cc
+++ b/chrome/browser/chromeos/extensions/file_browser_private_api.cc
@@ -11,7 +11,6 @@
#include "base/logging.h"
#include "base/memory/scoped_vector.h"
#include "base/memory/singleton.h"
-#include "base/memory/weak_ptr.h"
#include "base/string_split.h"
#include "base/stringprintf.h"
#include "base/time.h"
@@ -1089,13 +1088,11 @@ 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));
- }
+ const bool success = true;
+ FileBrowserEventRouterFactory::GetForProfile(profile_)->
+ MountDrive(base::Bind(&AddMountFunction::SendResponse,
+ this,
+ success));
break;
}
default: {
@@ -1114,33 +1111,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) {
« no previous file with comments | « chrome/browser/chromeos/extensions/file_browser_private_api.h ('k') | chrome/browser/chromeos/gdata/gdata_file_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698