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_PARSER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_API_PARSER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_API_PARSER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_API_PARSER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/scoped_vector.h" | 14 #include "base/memory/scoped_vector.h" |
15 #include "base/string_piece.h" | 15 #include "base/string_piece.h" |
16 #include "base/time.h" | 16 #include "base/time.h" |
17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 18 // TODO(kochi): Eliminate this dependency once dependency to EntryKind is gone. |
| 19 // http://crbug.com/142293 |
| 20 #include "chrome/browser/chromeos/gdata/gdata_wapi_parser.h" |
18 | 21 |
19 namespace base { | 22 namespace base { |
20 class Value; | 23 class Value; |
21 template <class StructType> | 24 template <class StructType> |
22 class JSONValueConverter; | 25 class JSONValueConverter; |
23 | 26 |
24 namespace internal { | 27 namespace internal { |
25 template <class NestedType> | 28 template <class NestedType> |
26 class RepeatedMessageConverter; | 29 class RepeatedMessageConverter; |
27 } // namespace internal | 30 } // namespace internal |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 base::JSONValueConverter<FileResource>* converter); | 311 base::JSONValueConverter<FileResource>* converter); |
309 | 312 |
310 // Creates file resource from parsed JSON. | 313 // Creates file resource from parsed JSON. |
311 static scoped_ptr<FileResource> CreateFrom(const base::Value& value); | 314 static scoped_ptr<FileResource> CreateFrom(const base::Value& value); |
312 | 315 |
313 // Returns true if this is a directory. | 316 // Returns true if this is a directory. |
314 // Note: "folder" is used elsewhere in this file to match Drive API reference, | 317 // Note: "folder" is used elsewhere in this file to match Drive API reference, |
315 // but outside this file we use "directory" to match HTML5 filesystem API. | 318 // but outside this file we use "directory" to match HTML5 filesystem API. |
316 bool IsDirectory() const; | 319 bool IsDirectory() const; |
317 | 320 |
| 321 // Returns EntryKind for this file. |
| 322 // TODO(kochi): Remove this once FileResource is directly converted to proto. |
| 323 // http://crbug.com/142293 |
| 324 DocumentEntry::EntryKind GetKind() const; |
| 325 |
318 // Returns file ID. This is unique in all files in Google Drive. | 326 // Returns file ID. This is unique in all files in Google Drive. |
319 const std::string& file_id() const { return file_id_; } | 327 const std::string& file_id() const { return file_id_; } |
320 | 328 |
321 // Returns ETag for this file. | 329 // Returns ETag for this file. |
322 const std::string& etag() const { return etag_; } | 330 const std::string& etag() const { return etag_; } |
323 | 331 |
324 // Returns the link to JSON of this file itself. | 332 // Returns the link to JSON of this file itself. |
325 const GURL& self_link() const { return self_link_; } | 333 const GURL& self_link() const { return self_link_; } |
326 | 334 |
327 // Returns the title of this file. | 335 // Returns the title of this file. |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
530 GURL next_link_; | 538 GURL next_link_; |
531 int64 largest_change_id_; | 539 int64 largest_change_id_; |
532 ScopedVector<ChangeResource> items_; | 540 ScopedVector<ChangeResource> items_; |
533 | 541 |
534 DISALLOW_COPY_AND_ASSIGN(ChangeList); | 542 DISALLOW_COPY_AND_ASSIGN(ChangeList); |
535 }; | 543 }; |
536 | 544 |
537 } // namespace gdata | 545 } // namespace gdata |
538 | 546 |
539 #endif // CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_API_PARSER_H_ | 547 #endif // CHROME_BROWSER_CHROMEOS_GDATA_DRIVE_API_PARSER_H_ |
OLD | NEW |