OLD | NEW |
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 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_API_OPERATIONS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_API_OPERATIONS_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_API_OPERATIONS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_API_OPERATIONS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "chrome/browser/chromeos/gdata/operations_base.h" | 11 #include "chrome/browser/chromeos/gdata/operations_base.h" |
12 | 12 |
13 // TODO(kochi): Rename to namespace drive. http://crbug.com/136371 | 13 // TODO(kochi): Rename to namespace drive. http://crbug.com/136371 |
14 namespace gdata { | 14 namespace gdata { |
15 | 15 |
16 //============================== GetAboutOperation ============================= | 16 //============================== GetAboutOperation ============================= |
17 | 17 |
18 // This class performs the operation for fetching About data. | 18 // This class performs the operation for fetching About data. |
19 class GetAboutOperation : public GetDataOperation { | 19 class GetAboutOperation : public GetDataOperation { |
20 public: | 20 public: |
21 GetAboutOperation(GDataOperationRegistry* registry, | 21 GetAboutOperation(OperationRegistry* registry, |
22 const GetDataCallback& callback); | 22 const GetDataCallback& callback); |
23 virtual ~GetAboutOperation(); | 23 virtual ~GetAboutOperation(); |
24 | 24 |
25 protected: | 25 protected: |
26 // Overridden from GetDataOperation. | 26 // Overridden from GetDataOperation. |
27 virtual GURL GetURL() const OVERRIDE; | 27 virtual GURL GetURL() const OVERRIDE; |
28 | 28 |
29 private: | 29 private: |
30 DISALLOW_COPY_AND_ASSIGN(GetAboutOperation); | 30 DISALLOW_COPY_AND_ASSIGN(GetAboutOperation); |
31 }; | 31 }; |
32 | 32 |
33 //============================= GetApplistOperation ============================ | 33 //============================= GetApplistOperation ============================ |
34 | 34 |
35 // This class performs the operation for fetching Applist. | 35 // This class performs the operation for fetching Applist. |
36 class GetApplistOperation : public GetDataOperation { | 36 class GetApplistOperation : public GetDataOperation { |
37 public: | 37 public: |
38 GetApplistOperation(GDataOperationRegistry* registry, | 38 GetApplistOperation(OperationRegistry* registry, |
39 const GetDataCallback& callback); | 39 const GetDataCallback& callback); |
40 virtual ~GetApplistOperation(); | 40 virtual ~GetApplistOperation(); |
41 | 41 |
42 protected: | 42 protected: |
43 // Overridden from GetDataOperation. | 43 // Overridden from GetDataOperation. |
44 virtual GURL GetURL() const OVERRIDE; | 44 virtual GURL GetURL() const OVERRIDE; |
45 | 45 |
46 private: | 46 private: |
47 DISALLOW_COPY_AND_ASSIGN(GetApplistOperation); | 47 DISALLOW_COPY_AND_ASSIGN(GetApplistOperation); |
48 }; | 48 }; |
49 | 49 |
50 //============================ GetChangelistOperation ========================== | 50 //============================ GetChangelistOperation ========================== |
51 | 51 |
52 // This class performs the operation for fetching changelist. | 52 // This class performs the operation for fetching changelist. |
53 class GetChangelistOperation : public GetDataOperation { | 53 class GetChangelistOperation : public GetDataOperation { |
54 public: | 54 public: |
55 // |start_changestamp| specifies the starting point of change list or 0 if | 55 // |start_changestamp| specifies the starting point of change list or 0 if |
56 // all changes are necessary. | 56 // all changes are necessary. |
57 // |url| specifies URL for document feed fetching operation. If empty URL is | 57 // |url| specifies URL for document feed fetching operation. If empty URL is |
58 // passed, the default URL is used and returns the first page of the result. | 58 // passed, the default URL is used and returns the first page of the result. |
59 // When non-first page result is requested, |url| should be specified. | 59 // When non-first page result is requested, |url| should be specified. |
60 GetChangelistOperation(GDataOperationRegistry* registry, | 60 GetChangelistOperation(OperationRegistry* registry, |
61 const GURL& url, | 61 const GURL& url, |
62 int64 start_changestamp, | 62 int64 start_changestamp, |
63 const GetDataCallback& callback); | 63 const GetDataCallback& callback); |
64 virtual ~GetChangelistOperation(); | 64 virtual ~GetChangelistOperation(); |
65 | 65 |
66 protected: | 66 protected: |
67 // Overridden from GetDataOperation. | 67 // Overridden from GetDataOperation. |
68 virtual GURL GetURL() const OVERRIDE; | 68 virtual GURL GetURL() const OVERRIDE; |
69 | 69 |
70 private: | 70 private: |
71 GURL url_; | 71 GURL url_; |
72 int64 start_changestamp_; | 72 int64 start_changestamp_; |
73 | 73 |
74 DISALLOW_COPY_AND_ASSIGN(GetChangelistOperation); | 74 DISALLOW_COPY_AND_ASSIGN(GetChangelistOperation); |
75 }; | 75 }; |
76 | 76 |
77 //============================= GetFlielistOperation =========================== | 77 //============================= GetFlielistOperation =========================== |
78 | 78 |
79 // This class performs the operation for fetching Filelist. | 79 // This class performs the operation for fetching Filelist. |
80 class GetFilelistOperation : public GetDataOperation { | 80 class GetFilelistOperation : public GetDataOperation { |
81 public: | 81 public: |
82 GetFilelistOperation(GDataOperationRegistry* registry, | 82 GetFilelistOperation(OperationRegistry* registry, |
83 const GURL& url, | 83 const GURL& url, |
84 const std::string& search_string, | 84 const std::string& search_string, |
85 const GetDataCallback& callback); | 85 const GetDataCallback& callback); |
86 virtual ~GetFilelistOperation(); | 86 virtual ~GetFilelistOperation(); |
87 | 87 |
88 protected: | 88 protected: |
89 // Overridden from GetDataOperation. | 89 // Overridden from GetDataOperation. |
90 virtual GURL GetURL() const OVERRIDE; | 90 virtual GURL GetURL() const OVERRIDE; |
91 | 91 |
92 private: | 92 private: |
93 GURL url_; | 93 GURL url_; |
94 std::string search_string_; | 94 std::string search_string_; |
95 | 95 |
96 DISALLOW_COPY_AND_ASSIGN(GetFilelistOperation); | 96 DISALLOW_COPY_AND_ASSIGN(GetFilelistOperation); |
97 }; | 97 }; |
98 | 98 |
99 //=============================== GetFlieOperation ============================= | 99 //=============================== GetFlieOperation ============================= |
100 | 100 |
101 // This class performs the operation for fetching a file. | 101 // This class performs the operation for fetching a file. |
102 class GetFileOperation : public GetDataOperation { | 102 class GetFileOperation : public GetDataOperation { |
103 public: | 103 public: |
104 GetFileOperation(GDataOperationRegistry* registry, | 104 GetFileOperation(OperationRegistry* registry, |
105 const std::string& file_id, | 105 const std::string& file_id, |
106 const GetDataCallback& callback); | 106 const GetDataCallback& callback); |
107 virtual ~GetFileOperation(); | 107 virtual ~GetFileOperation(); |
108 | 108 |
109 protected: | 109 protected: |
110 // Overridden from GetDataOperation. | 110 // Overridden from GetDataOperation. |
111 virtual GURL GetURL() const OVERRIDE; | 111 virtual GURL GetURL() const OVERRIDE; |
112 | 112 |
113 private: | 113 private: |
114 std::string file_id_; | 114 std::string file_id_; |
115 | 115 |
116 DISALLOW_COPY_AND_ASSIGN(GetFileOperation); | 116 DISALLOW_COPY_AND_ASSIGN(GetFileOperation); |
117 }; | 117 }; |
118 | 118 |
119 } // namespace gdata | 119 } // namespace gdata |
120 | 120 |
121 #endif // CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_API_OPERATIONS_H_ | 121 #endif // CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_API_OPERATIONS_H_ |
OLD | NEW |