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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/gdata/drive_api_operations.h" 5 #include "chrome/browser/chromeos/gdata/drive_api_operations.h"
6 6
7 #include "base/string_number_conversions.h"
8 #include "chrome/common/net/url_util.h"
9
7 namespace { 10 namespace {
8 11
9 const char kDriveV2AboutURL[] = "https://www.googleapis.com/drive/v2/about"; 12 const char kDriveV2AboutURL[] = "https://www.googleapis.com/drive/v2/about";
10 const char kDriveV2ApplistURL[] = "https://www.googleapis.com/drive/v2/apps"; 13 const char kDriveV2ApplistURL[] = "https://www.googleapis.com/drive/v2/apps";
14 const char kDriveV2ChangelistURL[] =
15 "https://www.googleapis.com/drive/v2/changes";
11 16
12 } // namespace 17 } // namespace
13 18
14 // TODO(kochi): Rename to namespace drive. http://crbug.com/136371 19 // TODO(kochi): Rename to namespace drive. http://crbug.com/136371
15 namespace gdata { 20 namespace gdata {
16 21
17 //============================== GetAboutOperation ============================= 22 //============================== GetAboutOperation =============================
18 23
19 GetAboutOperation::GetAboutOperation(GDataOperationRegistry* registry, 24 GetAboutOperation::GetAboutOperation(GDataOperationRegistry* registry,
20 const GetDataCallback& callback) 25 const GetDataCallback& callback)
(...skipping 10 matching lines...) Expand all
31 GetApplistOperation::GetApplistOperation(GDataOperationRegistry* registry, 36 GetApplistOperation::GetApplistOperation(GDataOperationRegistry* registry,
32 const GetDataCallback& callback) 37 const GetDataCallback& callback)
33 : GetDataOperation(registry, callback) {} 38 : GetDataOperation(registry, callback) {}
34 39
35 GetApplistOperation::~GetApplistOperation() {} 40 GetApplistOperation::~GetApplistOperation() {}
36 41
37 GURL GetApplistOperation::GetURL() const { 42 GURL GetApplistOperation::GetURL() const {
38 return GURL(kDriveV2ApplistURL); 43 return GURL(kDriveV2ApplistURL);
39 } 44 }
40 45
46 //============================ GetChangelistOperation ==========================
47
48 GetChangelistOperation::GetChangelistOperation(
49 GDataOperationRegistry* registry,
50 const GURL& url,
51 int64 start_changestamp,
52 const GetDataCallback& callback)
53 : GetDataOperation(registry, callback),
54 url_(kDriveV2ChangelistURL),
55 start_changestamp_(start_changestamp) {
56 if (!url.is_empty())
57 url_ = url;
58 }
59
60 GetChangelistOperation::~GetChangelistOperation() {}
61
62 GURL GetChangelistOperation::GetURL() const {
63 if (start_changestamp_)
64 return chrome_common_net::AppendOrReplaceQueryParameter(
65 url_, "startChangeId", base::Int64ToString(start_changestamp_));
66 return url_;
67 }
68
41 } // namespace gdata 69 } // namespace gdata
OLDNEW
« 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