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 #include "google_apis/drive/drive_api_parser.h" | 5 #include "google_apis/drive/drive_api_parser.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 const char kMd5Checksum[] = "md5Checksum"; | 147 const char kMd5Checksum[] = "md5Checksum"; |
148 const char kFileSize[] = "fileSize"; | 148 const char kFileSize[] = "fileSize"; |
149 const char kAlternateLink[] = "alternateLink"; | 149 const char kAlternateLink[] = "alternateLink"; |
150 const char kParents[] = "parents"; | 150 const char kParents[] = "parents"; |
151 const char kOpenWithLinks[] = "openWithLinks"; | 151 const char kOpenWithLinks[] = "openWithLinks"; |
152 const char kLabels[] = "labels"; | 152 const char kLabels[] = "labels"; |
153 const char kImageMediaMetadata[] = "imageMediaMetadata"; | 153 const char kImageMediaMetadata[] = "imageMediaMetadata"; |
154 const char kShared[] = "shared"; | 154 const char kShared[] = "shared"; |
155 // These 5 flags are defined under |labels|. | 155 // These 5 flags are defined under |labels|. |
156 const char kLabelTrashed[] = "trashed"; | 156 const char kLabelTrashed[] = "trashed"; |
| 157 const char kLabelStarred[] = "starred"; |
157 // These 3 flags are defined under |imageMediaMetadata|. | 158 // These 3 flags are defined under |imageMediaMetadata|. |
158 const char kImageMediaMetadataWidth[] = "width"; | 159 const char kImageMediaMetadataWidth[] = "width"; |
159 const char kImageMediaMetadataHeight[] = "height"; | 160 const char kImageMediaMetadataHeight[] = "height"; |
160 const char kImageMediaMetadataRotation[] = "rotation"; | 161 const char kImageMediaMetadataRotation[] = "rotation"; |
161 // URL to the share dialog UI, which is provided only in v2internal. | 162 // URL to the share dialog UI, which is provided only in v2internal. |
162 const char kShareLink[] = "shareLink"; | 163 const char kShareLink[] = "shareLink"; |
163 | 164 |
164 const char kDriveFolderMimeType[] = "application/vnd.google-apps.folder"; | 165 const char kDriveFolderMimeType[] = "application/vnd.google-apps.folder"; |
165 | 166 |
166 // Files List | 167 // Files List |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 LOG(ERROR) << "Unable to parse: Invalid ChangeList"; | 632 LOG(ERROR) << "Unable to parse: Invalid ChangeList"; |
632 return false; | 633 return false; |
633 } | 634 } |
634 return true; | 635 return true; |
635 } | 636 } |
636 | 637 |
637 | 638 |
638 //////////////////////////////////////////////////////////////////////////////// | 639 //////////////////////////////////////////////////////////////////////////////// |
639 // FileLabels implementation | 640 // FileLabels implementation |
640 | 641 |
641 FileLabels::FileLabels() : trashed_(false) {} | 642 FileLabels::FileLabels() |
| 643 : trashed_(false), |
| 644 starred_(false) {} |
642 | 645 |
643 FileLabels::~FileLabels() {} | 646 FileLabels::~FileLabels() {} |
644 | 647 |
645 // static | 648 // static |
646 void FileLabels::RegisterJSONConverter( | 649 void FileLabels::RegisterJSONConverter( |
647 base::JSONValueConverter<FileLabels>* converter) { | 650 base::JSONValueConverter<FileLabels>* converter) { |
648 converter->RegisterBoolField(kLabelTrashed, &FileLabels::trashed_); | 651 converter->RegisterBoolField(kLabelTrashed, &FileLabels::trashed_); |
| 652 converter->RegisterBoolField(kLabelStarred, &FileLabels::starred_); |
649 } | 653 } |
650 | 654 |
651 // static | 655 // static |
652 std::unique_ptr<FileLabels> FileLabels::CreateFrom(const base::Value& value) { | 656 std::unique_ptr<FileLabels> FileLabels::CreateFrom(const base::Value& value) { |
653 std::unique_ptr<FileLabels> resource(new FileLabels()); | 657 std::unique_ptr<FileLabels> resource(new FileLabels()); |
654 if (!resource->Parse(value)) { | 658 if (!resource->Parse(value)) { |
655 LOG(ERROR) << "Unable to create: Invalid FileLabels JSON!"; | 659 LOG(ERROR) << "Unable to create: Invalid FileLabels JSON!"; |
656 return std::unique_ptr<FileLabels>(); | 660 return std::unique_ptr<FileLabels>(); |
657 } | 661 } |
658 return resource; | 662 return resource; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 bool ImageMediaMetadata::Parse(const base::Value& value) { | 706 bool ImageMediaMetadata::Parse(const base::Value& value) { |
703 base::JSONValueConverter<ImageMediaMetadata> converter; | 707 base::JSONValueConverter<ImageMediaMetadata> converter; |
704 if (!converter.Convert(value, this)) { | 708 if (!converter.Convert(value, this)) { |
705 LOG(ERROR) << "Unable to parse: Invalid ImageMediaMetadata."; | 709 LOG(ERROR) << "Unable to parse: Invalid ImageMediaMetadata."; |
706 return false; | 710 return false; |
707 } | 711 } |
708 return true; | 712 return true; |
709 } | 713 } |
710 | 714 |
711 } // namespace google_apis | 715 } // namespace google_apis |
OLD | NEW |