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

Unified Diff: chrome/browser/chromeos/extensions/file_manager_util.cc

Issue 10270025: gdata: Remove use of FindEntryByPathAsync() from file_manager_util.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address Created 8 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata.proto » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/extensions/file_manager_util.cc
diff --git a/chrome/browser/chromeos/extensions/file_manager_util.cc b/chrome/browser/chromeos/extensions/file_manager_util.cc
index 67adf58efaf16fb9916ac87d9174882f0fb1852d..357d4bc555eb97eb4b1882153ab9255645e8d5f2 100644
--- a/chrome/browser/chromeos/extensions/file_manager_util.cc
+++ b/chrome/browser/chromeos/extensions/file_manager_util.cc
@@ -14,6 +14,7 @@
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/chromeos/extensions/file_handler_util.h"
+#include "chrome/browser/chromeos/gdata/gdata.pb.h"
#include "chrome/browser/chromeos/gdata/gdata_operation_registry.h"
#include "chrome/browser/chromeos/gdata/gdata_system_service.h"
#include "chrome/browser/chromeos/gdata/gdata_util.h"
@@ -242,18 +243,17 @@ void OnGDataFileFound(Profile* profile,
const FilePath& file_path,
gdata::GDataFileType file_type,
base::PlatformFileError error,
- const FilePath& /* directory_path */,
- gdata::GDataEntry* entry) {
+ scoped_ptr<gdata::GDataFileProto> file_proto) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- if (error == base::PLATFORM_FILE_OK && entry && entry->AsGDataFile()) {
- gdata::GDataFile* file = entry->AsGDataFile();
+ if (error == base::PLATFORM_FILE_OK) {
GURL page_url;
if (file_type == gdata::REGULAR_FILE) {
- page_url = gdata::util::GetFileResourceUrl(file->resource_id(),
- file->file_name());
+ page_url = gdata::util::GetFileResourceUrl(
+ file_proto->gdata_entry().resource_id(),
+ file_proto->gdata_entry().file_name());
} else if (file_type == gdata::HOSTED_DOCUMENT) {
- page_url = file->alternate_url();
+ page_url = GURL(file_proto->alternate_url());
} else {
NOTREACHED();
}
@@ -621,7 +621,7 @@ bool TryViewingFile(Profile* profile, const FilePath& path) {
return false;
// Open the file once the file is found.
- system_service->file_system()->FindEntryByPathAsync(
+ system_service->file_system()->GetFileInfoByPathAsync(
gdata::util::ExtractGDataPath(path),
base::Bind(&OnGDataFileFound, profile, path, gdata::REGULAR_FILE));
return true;
@@ -639,7 +639,7 @@ bool TryViewingFile(Profile* profile, const FilePath& path) {
if (!system_service)
return false;
- system_service->file_system()->FindEntryByPathAsync(
+ system_service->file_system()->GetFileInfoByPathAsync(
gdata::util::ExtractGDataPath(path),
base::Bind(&OnGDataFileFound, profile, path,
gdata::HOSTED_DOCUMENT));
« no previous file with comments | « no previous file | chrome/browser/chromeos/gdata/gdata.proto » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698