Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Side by Side Diff: google_apis/drive/drive_api_parser.h

Issue 2799603002: Process TeamDrive change in change list. (Closed)
Patch Set: Add test for update. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 // class. 403 // class.
404 static void RegisterJSONConverter( 404 static void RegisterJSONConverter(
405 base::JSONValueConverter<TeamDriveResource>* converter); 405 base::JSONValueConverter<TeamDriveResource>* converter);
406 406
407 // Creates Team Drive resource from parsed JSON. 407 // Creates Team Drive resource from parsed JSON.
408 static std::unique_ptr<TeamDriveResource> 408 static std::unique_ptr<TeamDriveResource>
409 CreateFrom(const base::Value& value); 409 CreateFrom(const base::Value& value);
410 410
411 // The ID of this Team Drive. The ID is the same as the top-level folder for 411 // The ID of this Team Drive. The ID is the same as the top-level folder for
412 // this Team Drive. 412 // this Team Drive.
413 void set_id(const std::string& id) { id_ = id; }
hashimoto 2017/04/06 10:23:36 Please put this after the getter (i.e. id()).
yamaguchi 2017/04/07 03:57:44 Done.
413 const std::string& id() const { return id_; } 414 const std::string& id() const { return id_; }
414 // The name of this Team Drive. 415 // The name of this Team Drive.
416 void set_name(const std::string& name) { name_ = name; }
hashimoto 2017/04/06 10:23:37 ditto.
yamaguchi 2017/04/07 03:57:44 Done.
415 const std::string& name() const { return name_; } 417 const std::string& name() const { return name_; }
416 // Capabilities the current user has on this Team Drive. 418 // Capabilities the current user has on this Team Drive.
417 const TeamDriveCapabilities& capabilities() const { return capabilities_; } 419 const TeamDriveCapabilities& capabilities() const { return capabilities_; }
418 420
419 private: 421 private:
420 friend class DriveAPIParserTest; 422 friend class DriveAPIParserTest;
421 FRIEND_TEST_ALL_PREFIXES(DriveAPIParserTest, TeamDriveResourceParser); 423 FRIEND_TEST_ALL_PREFIXES(DriveAPIParserTest, TeamDriveResourceParser);
422 424
423 // Parses and initializes data members from content of |value|. 425 // Parses and initializes data members from content of |value|.
424 // Return false if parsing fails. 426 // Return false if parsing fails.
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 TeamDriveResource* mutable_team_drive() { 854 TeamDriveResource* mutable_team_drive() {
853 DCHECK_EQ(TEAM_DRIVE, type_); 855 DCHECK_EQ(TEAM_DRIVE, type_);
854 return team_drive_.get(); 856 return team_drive_.get();
855 } 857 }
856 858
857 // Returns the ID of the Team Drive. Valid only when type == TEAM_DRIVE. 859 // Returns the ID of the Team Drive. Valid only when type == TEAM_DRIVE.
858 const std::string& team_drive_id() const { 860 const std::string& team_drive_id() const {
859 DCHECK_EQ(TEAM_DRIVE, type_); 861 DCHECK_EQ(TEAM_DRIVE, type_);
860 return team_drive_id_; 862 return team_drive_id_;
861 } 863 }
864 void set_team_drive_id(const std::string& team_drive_id) {
hashimoto 2017/04/06 10:23:36 Please put this setter next to the other setters (
yamaguchi 2017/04/07 03:57:44 Done.
865 team_drive_id_ = team_drive_id;
866 }
862 867
863 // Returns the time of this modification. 868 // Returns the time of this modification.
864 const base::Time& modification_date() const { return modification_date_; } 869 const base::Time& modification_date() const { return modification_date_; }
865 870
866 void set_change_id(int64_t change_id) { change_id_ = change_id; } 871 void set_change_id(int64_t change_id) { change_id_ = change_id; }
867 void set_type(ChangeType type) { type_ = type; } 872 void set_type(ChangeType type) { type_ = type; }
868 void set_file_id(const std::string& file_id) { 873 void set_file_id(const std::string& file_id) {
869 file_id_ = file_id; 874 file_id_ = file_id;
870 } 875 }
871 void set_deleted(bool deleted) { 876 void set_deleted(bool deleted) {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 GURL next_link_; 960 GURL next_link_;
956 int64_t largest_change_id_; 961 int64_t largest_change_id_;
957 std::vector<std::unique_ptr<ChangeResource>> items_; 962 std::vector<std::unique_ptr<ChangeResource>> items_;
958 963
959 DISALLOW_COPY_AND_ASSIGN(ChangeList); 964 DISALLOW_COPY_AND_ASSIGN(ChangeList);
960 }; 965 };
961 966
962 } // namespace google_apis 967 } // namespace google_apis
963 968
964 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_ 969 #endif // GOOGLE_APIS_DRIVE_DRIVE_API_PARSER_H_
OLDNEW
« components/drive/drive.proto ('K') | « components/drive/resource_metadata_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698