| Index: chrome/browser/chromeos/gdata/drive_api_operations.cc
|
| diff --git a/chrome/browser/chromeos/gdata/drive_api_operations.cc b/chrome/browser/chromeos/gdata/drive_api_operations.cc
|
| index 778d3b7fbe5f00bdf7d9b59e11161e0123901127..bcdf628f695357b1cebfaea71dd67ea09cd75890 100644
|
| --- a/chrome/browser/chromeos/gdata/drive_api_operations.cc
|
| +++ b/chrome/browser/chromeos/gdata/drive_api_operations.cc
|
| @@ -5,6 +5,7 @@
|
| #include "chrome/browser/chromeos/gdata/drive_api_operations.h"
|
|
|
| #include "base/string_number_conversions.h"
|
| +#include "base/stringprintf.h"
|
| #include "chrome/common/net/url_util.h"
|
|
|
| namespace {
|
| @@ -14,6 +15,10 @@ const char kDriveV2ApplistURL[] = "https://www.googleapis.com/drive/v2/apps";
|
| const char kDriveV2ChangelistURL[] =
|
| "https://www.googleapis.com/drive/v2/changes";
|
|
|
| +const char kDriveV2FilelistURL[] = "https://www.googleapis.com/drive/v2/files";
|
| +const char kDriveV2FileURLFormat[] =
|
| + "https://www.googleapis.com/drive/v2/files/%s";
|
| +
|
| } // namespace
|
|
|
| // TODO(kochi): Rename to namespace drive. http://crbug.com/136371
|
| @@ -66,4 +71,43 @@ GURL GetChangelistOperation::GetURL() const {
|
| return url_;
|
| }
|
|
|
| +//============================= GetFlielistOperation ===========================
|
| +
|
| +GetFilelistOperation::GetFilelistOperation(
|
| + GDataOperationRegistry* registry,
|
| + const GURL& url,
|
| + const std::string& search_string,
|
| + const GetDataCallback& callback)
|
| + : GetDataOperation(registry, callback),
|
| + url_(kDriveV2FilelistURL),
|
| + search_string_(search_string) {
|
| + if (!url.is_empty())
|
| + url_ = url;
|
| +}
|
| +
|
| +GetFilelistOperation::~GetFilelistOperation() {}
|
| +
|
| +GURL GetFilelistOperation::GetURL() const {
|
| + if (!search_string_.empty()) {
|
| + return chrome_common_net::AppendOrReplaceQueryParameter(
|
| + url_, "q", search_string_);
|
| + }
|
| + return url_;
|
| +}
|
| +
|
| +//=============================== GetFlieOperation =============================
|
| +
|
| +GetFileOperation::GetFileOperation(
|
| + GDataOperationRegistry* registry,
|
| + const std::string& file_id,
|
| + const GetDataCallback& callback)
|
| + : GetDataOperation(registry, callback),
|
| + file_id_(file_id) {}
|
| +
|
| +GetFileOperation::~GetFileOperation() {}
|
| +
|
| +GURL GetFileOperation::GetURL() const {
|
| + return GURL(base::StringPrintf(kDriveV2FileURLFormat, file_id_.c_str()));
|
| +}
|
| +
|
| } // namespace gdata
|
|
|