Chromium Code Reviews| 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..9082d6b3e2341d4780e1a3fd97c44cd519da39cd 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,42 @@ 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()) |
|
satorux1
2012/08/14 13:17:21
add {}
kochi
2012/08/15 04:17:17
Done.
|
| + 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 |