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 GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_ | 5 #ifndef GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_ |
6 #define GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_ | 6 #define GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 base::JSONValueConverter<AboutResource>* converter); | 41 base::JSONValueConverter<AboutResource>* converter); |
42 | 42 |
43 // Creates about resource from parsed JSON. | 43 // Creates about resource from parsed JSON. |
44 static scoped_ptr<AboutResource> CreateFrom(const base::Value& value); | 44 static scoped_ptr<AboutResource> CreateFrom(const base::Value& value); |
45 | 45 |
46 // Returns the largest change ID number. | 46 // Returns the largest change ID number. |
47 int64 largest_change_id() const { return largest_change_id_; } | 47 int64 largest_change_id() const { return largest_change_id_; } |
48 // Returns total number of quota bytes. | 48 // Returns total number of quota bytes. |
49 int64 quota_bytes_total() const { return quota_bytes_total_; } | 49 int64 quota_bytes_total() const { return quota_bytes_total_; } |
50 // Returns the number of quota bytes used. | 50 // Returns the number of quota bytes used. |
51 int64 quota_bytes_used() const { return quota_bytes_used_; } | 51 int64 quota_bytes_used_aggregate() const { |
| 52 return quota_bytes_used_aggregate_; |
| 53 } |
52 // Returns root folder ID. | 54 // Returns root folder ID. |
53 const std::string& root_folder_id() const { return root_folder_id_; } | 55 const std::string& root_folder_id() const { return root_folder_id_; } |
54 | 56 |
55 void set_largest_change_id(int64 largest_change_id) { | 57 void set_largest_change_id(int64 largest_change_id) { |
56 largest_change_id_ = largest_change_id; | 58 largest_change_id_ = largest_change_id; |
57 } | 59 } |
58 void set_quota_bytes_total(int64 quota_bytes_total) { | 60 void set_quota_bytes_total(int64 quota_bytes_total) { |
59 quota_bytes_total_ = quota_bytes_total; | 61 quota_bytes_total_ = quota_bytes_total; |
60 } | 62 } |
61 void set_quota_bytes_used(int64 quota_bytes_used) { | 63 void set_quota_bytes_used_aggregate(int64 quota_bytes_used_aggregate) { |
62 quota_bytes_used_ = quota_bytes_used; | 64 quota_bytes_used_aggregate_ = quota_bytes_used_aggregate; |
63 } | 65 } |
64 void set_root_folder_id(const std::string& root_folder_id) { | 66 void set_root_folder_id(const std::string& root_folder_id) { |
65 root_folder_id_ = root_folder_id; | 67 root_folder_id_ = root_folder_id; |
66 } | 68 } |
67 | 69 |
68 private: | 70 private: |
69 friend class DriveAPIParserTest; | 71 friend class DriveAPIParserTest; |
70 FRIEND_TEST_ALL_PREFIXES(DriveAPIParserTest, AboutResourceParser); | 72 FRIEND_TEST_ALL_PREFIXES(DriveAPIParserTest, AboutResourceParser); |
71 | 73 |
72 // Parses and initializes data members from content of |value|. | 74 // Parses and initializes data members from content of |value|. |
73 // Return false if parsing fails. | 75 // Return false if parsing fails. |
74 bool Parse(const base::Value& value); | 76 bool Parse(const base::Value& value); |
75 | 77 |
76 int64 largest_change_id_; | 78 int64 largest_change_id_; |
77 int64 quota_bytes_total_; | 79 int64 quota_bytes_total_; |
78 int64 quota_bytes_used_; | 80 int64 quota_bytes_used_aggregate_; |
79 std::string root_folder_id_; | 81 std::string root_folder_id_; |
80 | 82 |
81 // This class is copyable on purpose. | 83 // This class is copyable on purpose. |
82 }; | 84 }; |
83 | 85 |
84 // DriveAppIcon represents an icon for Drive Application. | 86 // DriveAppIcon represents an icon for Drive Application. |
85 // https://developers.google.com/drive/v2/reference/apps | 87 // https://developers.google.com/drive/v2/reference/apps |
86 class DriveAppIcon { | 88 class DriveAppIcon { |
87 public: | 89 public: |
88 enum IconCategory { | 90 enum IconCategory { |
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 GURL next_link_; | 747 GURL next_link_; |
746 int64 largest_change_id_; | 748 int64 largest_change_id_; |
747 ScopedVector<ChangeResource> items_; | 749 ScopedVector<ChangeResource> items_; |
748 | 750 |
749 DISALLOW_COPY_AND_ASSIGN(ChangeList); | 751 DISALLOW_COPY_AND_ASSIGN(ChangeList); |
750 }; | 752 }; |
751 | 753 |
752 } // namespace google_apis | 754 } // namespace google_apis |
753 | 755 |
754 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_ | 756 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_ |
OLD | NEW |