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

Unified Diff: chrome/browser/chromeos/gdata/drive_api_operations.cc

Issue 10836125: Add GetChangelist operation for Drive V2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove SetURL() and specify url in the constructor. 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/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 fdc3f012e02ec7340c1a1a376e73f2082e19bb76..778d3b7fbe5f00bdf7d9b59e11161e0123901127 100644
--- a/chrome/browser/chromeos/gdata/drive_api_operations.cc
+++ b/chrome/browser/chromeos/gdata/drive_api_operations.cc
@@ -4,10 +4,15 @@
#include "chrome/browser/chromeos/gdata/drive_api_operations.h"
+#include "base/string_number_conversions.h"
+#include "chrome/common/net/url_util.h"
+
namespace {
const char kDriveV2AboutURL[] = "https://www.googleapis.com/drive/v2/about";
const char kDriveV2ApplistURL[] = "https://www.googleapis.com/drive/v2/apps";
+const char kDriveV2ChangelistURL[] =
+ "https://www.googleapis.com/drive/v2/changes";
} // namespace
@@ -38,4 +43,27 @@ GURL GetApplistOperation::GetURL() const {
return GURL(kDriveV2ApplistURL);
}
+//============================ GetChangelistOperation ==========================
+
+GetChangelistOperation::GetChangelistOperation(
+ GDataOperationRegistry* registry,
+ const GURL& url,
+ int64 start_changestamp,
+ const GetDataCallback& callback)
+ : GetDataOperation(registry, callback),
+ url_(kDriveV2ChangelistURL),
+ start_changestamp_(start_changestamp) {
+ if (!url.is_empty())
+ url_ = url;
+}
+
+GetChangelistOperation::~GetChangelistOperation() {}
+
+GURL GetChangelistOperation::GetURL() const {
+ if (start_changestamp_)
+ return chrome_common_net::AppendOrReplaceQueryParameter(
+ url_, "startChangeId", base::Int64ToString(start_changestamp_));
+ return url_;
+}
+
} // namespace gdata
« no previous file with comments | « chrome/browser/chromeos/gdata/drive_api_operations.h ('k') | chrome/browser/chromeos/gdata/gdata_documents_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698