Chromium Code Reviews| 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_GOOGLE_APIS_DRIVE_API_OPERATIONS_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_OPERATIONS_H_ |
| 6 #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_OPERATIONS_H_ | 6 #define CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_OPERATIONS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chrome/browser/google_apis/base_operations.h" | 10 #include "chrome/browser/google_apis/base_operations.h" |
| 11 #include "chrome/browser/google_apis/drive_api_url_generator.h" | |
| 11 | 12 |
| 12 namespace net { | 13 namespace net { |
| 13 class URLRequestContextGetter; | 14 class URLRequestContextGetter; |
| 14 } // namespace net | 15 } // namespace net |
| 15 | 16 |
| 16 namespace google_apis { | 17 namespace google_apis { |
| 17 | 18 |
| 18 //============================== GetAboutOperation ============================= | 19 //============================== GetAboutOperation ============================= |
| 19 | 20 |
| 20 // This class performs the operation for fetching About data. | 21 // This class performs the operation for fetching About data. |
| 21 class GetAboutOperation : public GetDataOperation { | 22 class GetAboutOperation : public GetDataOperation { |
| 22 public: | 23 public: |
| 23 GetAboutOperation(OperationRegistry* registry, | 24 GetAboutOperation(OperationRegistry* registry, |
| 24 net::URLRequestContextGetter* url_request_context_getter, | 25 net::URLRequestContextGetter* url_request_context_getter, |
| 26 const DriveApiUrlGenerator& url_generator, | |
| 25 const GetDataCallback& callback); | 27 const GetDataCallback& callback); |
| 26 virtual ~GetAboutOperation(); | 28 virtual ~GetAboutOperation(); |
| 27 | 29 |
| 28 protected: | 30 protected: |
| 29 // Overridden from GetDataOperation. | 31 // Overridden from GetDataOperation. |
| 30 virtual GURL GetURL() const OVERRIDE; | 32 virtual GURL GetURL() const OVERRIDE; |
| 31 | 33 |
| 32 private: | 34 private: |
| 35 DriveApiUrlGenerator url_generator_; | |
|
satorux1
2013/01/08 03:29:13
const?
hidehiko
2013/01/08 03:54:48
Done.
| |
| 36 | |
| 33 DISALLOW_COPY_AND_ASSIGN(GetAboutOperation); | 37 DISALLOW_COPY_AND_ASSIGN(GetAboutOperation); |
| 34 }; | 38 }; |
| 35 | 39 |
| 36 //============================= GetApplistOperation ============================ | 40 //============================= GetApplistOperation ============================ |
| 37 | 41 |
| 38 // This class performs the operation for fetching Applist. | 42 // This class performs the operation for fetching Applist. |
| 39 class GetApplistOperation : public GetDataOperation { | 43 class GetApplistOperation : public GetDataOperation { |
| 40 public: | 44 public: |
| 41 GetApplistOperation(OperationRegistry* registry, | 45 GetApplistOperation(OperationRegistry* registry, |
| 42 net::URLRequestContextGetter* url_request_context_getter, | 46 net::URLRequestContextGetter* url_request_context_getter, |
| 47 const DriveApiUrlGenerator& url_generator, | |
| 43 const GetDataCallback& callback); | 48 const GetDataCallback& callback); |
| 44 virtual ~GetApplistOperation(); | 49 virtual ~GetApplistOperation(); |
| 45 | 50 |
| 46 protected: | 51 protected: |
| 47 // Overridden from GetDataOperation. | 52 // Overridden from GetDataOperation. |
| 48 virtual GURL GetURL() const OVERRIDE; | 53 virtual GURL GetURL() const OVERRIDE; |
| 49 | 54 |
| 50 private: | 55 private: |
| 56 DriveApiUrlGenerator url_generator_; | |
|
satorux1
2013/01/08 03:29:13
ditto. please check other places too
hidehiko
2013/01/08 03:54:48
Done. Ditto for below similar ones.
| |
| 57 | |
| 51 DISALLOW_COPY_AND_ASSIGN(GetApplistOperation); | 58 DISALLOW_COPY_AND_ASSIGN(GetApplistOperation); |
| 52 }; | 59 }; |
| 53 | 60 |
| 54 //============================ GetChangelistOperation ========================== | 61 //============================ GetChangelistOperation ========================== |
| 55 | 62 |
| 56 // This class performs the operation for fetching changelist. | 63 // This class performs the operation for fetching changelist. |
| 57 class GetChangelistOperation : public GetDataOperation { | 64 class GetChangelistOperation : public GetDataOperation { |
| 58 public: | 65 public: |
| 59 // |start_changestamp| specifies the starting point of change list or 0 if | 66 // |start_changestamp| specifies the starting point of change list or 0 if |
| 60 // all changes are necessary. | 67 // all changes are necessary. |
| 61 // |url| specifies URL for document feed fetching operation. If empty URL is | 68 // |url| specifies URL for document feed fetching operation. If empty URL is |
| 62 // passed, the default URL is used and returns the first page of the result. | 69 // passed, the default URL is used and returns the first page of the result. |
| 63 // When non-first page result is requested, |url| should be specified. | 70 // When non-first page result is requested, |url| should be specified. |
| 64 GetChangelistOperation( | 71 GetChangelistOperation( |
| 65 OperationRegistry* registry, | 72 OperationRegistry* registry, |
| 66 net::URLRequestContextGetter* url_request_context_getter, | 73 net::URLRequestContextGetter* url_request_context_getter, |
| 74 const DriveApiUrlGenerator& url_generator, | |
| 67 const GURL& url, | 75 const GURL& url, |
| 68 int64 start_changestamp, | 76 int64 start_changestamp, |
| 69 const GetDataCallback& callback); | 77 const GetDataCallback& callback); |
| 70 virtual ~GetChangelistOperation(); | 78 virtual ~GetChangelistOperation(); |
| 71 | 79 |
| 72 protected: | 80 protected: |
| 73 // Overridden from GetDataOperation. | 81 // Overridden from GetDataOperation. |
| 74 virtual GURL GetURL() const OVERRIDE; | 82 virtual GURL GetURL() const OVERRIDE; |
| 75 | 83 |
| 76 private: | 84 private: |
| 85 DriveApiUrlGenerator url_generator_; | |
| 77 GURL url_; | 86 GURL url_; |
| 78 int64 start_changestamp_; | 87 int64 start_changestamp_; |
| 79 | 88 |
| 80 DISALLOW_COPY_AND_ASSIGN(GetChangelistOperation); | 89 DISALLOW_COPY_AND_ASSIGN(GetChangelistOperation); |
| 81 }; | 90 }; |
| 82 | 91 |
| 83 //============================= GetFlielistOperation =========================== | 92 //============================= GetFlielistOperation =========================== |
| 84 | 93 |
| 85 // This class performs the operation for fetching Filelist. | 94 // This class performs the operation for fetching Filelist. |
| 86 class GetFilelistOperation : public GetDataOperation { | 95 class GetFilelistOperation : public GetDataOperation { |
| 87 public: | 96 public: |
| 88 GetFilelistOperation( | 97 GetFilelistOperation( |
| 89 OperationRegistry* registry, | 98 OperationRegistry* registry, |
| 90 net::URLRequestContextGetter* url_request_context_getter, | 99 net::URLRequestContextGetter* url_request_context_getter, |
| 100 const DriveApiUrlGenerator& url_generator, | |
| 91 const GURL& url, | 101 const GURL& url, |
| 92 const std::string& search_string, | 102 const std::string& search_string, |
| 93 const GetDataCallback& callback); | 103 const GetDataCallback& callback); |
| 94 virtual ~GetFilelistOperation(); | 104 virtual ~GetFilelistOperation(); |
| 95 | 105 |
| 96 protected: | 106 protected: |
| 97 // Overridden from GetDataOperation. | 107 // Overridden from GetDataOperation. |
| 98 virtual GURL GetURL() const OVERRIDE; | 108 virtual GURL GetURL() const OVERRIDE; |
| 99 | 109 |
| 100 private: | 110 private: |
| 111 DriveApiUrlGenerator url_generator_; | |
| 101 GURL url_; | 112 GURL url_; |
| 102 std::string search_string_; | 113 std::string search_string_; |
| 103 | 114 |
| 104 DISALLOW_COPY_AND_ASSIGN(GetFilelistOperation); | 115 DISALLOW_COPY_AND_ASSIGN(GetFilelistOperation); |
| 105 }; | 116 }; |
| 106 | 117 |
| 107 //=============================== GetFlieOperation ============================= | 118 //=============================== GetFlieOperation ============================= |
| 108 | 119 |
| 109 // This class performs the operation for fetching a file. | 120 // This class performs the operation for fetching a file. |
| 110 class GetFileOperation : public GetDataOperation { | 121 class GetFileOperation : public GetDataOperation { |
| 111 public: | 122 public: |
| 112 GetFileOperation(OperationRegistry* registry, | 123 GetFileOperation(OperationRegistry* registry, |
| 113 net::URLRequestContextGetter* url_request_context_getter, | 124 net::URLRequestContextGetter* url_request_context_getter, |
| 125 const DriveApiUrlGenerator& url_generator, | |
| 114 const std::string& file_id, | 126 const std::string& file_id, |
| 115 const GetDataCallback& callback); | 127 const GetDataCallback& callback); |
| 116 virtual ~GetFileOperation(); | 128 virtual ~GetFileOperation(); |
| 117 | 129 |
| 118 protected: | 130 protected: |
| 119 // Overridden from GetDataOperation. | 131 // Overridden from GetDataOperation. |
| 120 virtual GURL GetURL() const OVERRIDE; | 132 virtual GURL GetURL() const OVERRIDE; |
| 121 | 133 |
| 122 private: | 134 private: |
| 135 DriveApiUrlGenerator url_generator_; | |
| 123 std::string file_id_; | 136 std::string file_id_; |
| 124 | 137 |
| 125 DISALLOW_COPY_AND_ASSIGN(GetFileOperation); | 138 DISALLOW_COPY_AND_ASSIGN(GetFileOperation); |
| 126 }; | 139 }; |
| 127 | 140 |
| 128 } // namespace google_apis | 141 } // namespace google_apis |
| 129 | 142 |
| 130 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_OPERATIONS_H_ | 143 #endif // CHROME_BROWSER_GOOGLE_APIS_DRIVE_API_OPERATIONS_H_ |
| OLD | NEW |