| 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 "chrome/browser/google_apis/drive_api_parser.h" | 5 #include "chrome/browser/google_apis/drive_api_parser.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 if (!converter.Convert(value, this)) { | 207 if (!converter.Convert(value, this)) { |
| 208 LOG(ERROR) << "Unable to parse: Invalid About resource JSON!"; | 208 LOG(ERROR) << "Unable to parse: Invalid About resource JSON!"; |
| 209 return false; | 209 return false; |
| 210 } | 210 } |
| 211 return true; | 211 return true; |
| 212 } | 212 } |
| 213 | 213 |
| 214 //////////////////////////////////////////////////////////////////////////////// | 214 //////////////////////////////////////////////////////////////////////////////// |
| 215 // DriveAppIcon implementation | 215 // DriveAppIcon implementation |
| 216 | 216 |
| 217 DriveAppIcon::DriveAppIcon() {} | 217 DriveAppIcon::DriveAppIcon() : category_(UNKNOWN), icon_side_length_(0) {} |
| 218 | 218 |
| 219 DriveAppIcon::~DriveAppIcon() {} | 219 DriveAppIcon::~DriveAppIcon() {} |
| 220 | 220 |
| 221 // static | 221 // static |
| 222 void DriveAppIcon::RegisterJSONConverter( | 222 void DriveAppIcon::RegisterJSONConverter( |
| 223 base::JSONValueConverter<DriveAppIcon>* converter) { | 223 base::JSONValueConverter<DriveAppIcon>* converter) { |
| 224 converter->RegisterCustomField<IconCategory>( | 224 converter->RegisterCustomField<IconCategory>( |
| 225 kCategory, | 225 kCategory, |
| 226 &DriveAppIcon::category_, | 226 &DriveAppIcon::category_, |
| 227 &DriveAppIcon::GetIconCategory); | 227 &DriveAppIcon::GetIconCategory); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 return true; | 259 return true; |
| 260 } | 260 } |
| 261 } | 261 } |
| 262 DVLOG(1) << "Unknown icon category " << category; | 262 DVLOG(1) << "Unknown icon category " << category; |
| 263 return false; | 263 return false; |
| 264 } | 264 } |
| 265 | 265 |
| 266 //////////////////////////////////////////////////////////////////////////////// | 266 //////////////////////////////////////////////////////////////////////////////// |
| 267 // AppResource implementation | 267 // AppResource implementation |
| 268 | 268 |
| 269 AppResource::AppResource() {} | 269 AppResource::AppResource() |
| 270 : supports_create_(false), |
| 271 supports_import_(false), |
| 272 installed_(false), |
| 273 authorized_(false) { |
| 274 } |
| 270 | 275 |
| 271 AppResource::~AppResource() {} | 276 AppResource::~AppResource() {} |
| 272 | 277 |
| 273 // static | 278 // static |
| 274 void AppResource::RegisterJSONConverter( | 279 void AppResource::RegisterJSONConverter( |
| 275 base::JSONValueConverter<AppResource>* converter) { | 280 base::JSONValueConverter<AppResource>* converter) { |
| 276 converter->RegisterStringField(kId, &AppResource::application_id_); | 281 converter->RegisterStringField(kId, &AppResource::application_id_); |
| 277 converter->RegisterStringField(kName, &AppResource::name_); | 282 converter->RegisterStringField(kName, &AppResource::name_); |
| 278 converter->RegisterStringField(kObjectType, &AppResource::object_type_); | 283 converter->RegisterStringField(kObjectType, &AppResource::object_type_); |
| 279 converter->RegisterBoolField(kSupportsCreate, &AppResource::supports_create_); | 284 converter->RegisterBoolField(kSupportsCreate, &AppResource::supports_create_); |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 bool FileLabels::Parse(const base::Value& value) { | 637 bool FileLabels::Parse(const base::Value& value) { |
| 633 base::JSONValueConverter<FileLabels> converter; | 638 base::JSONValueConverter<FileLabels> converter; |
| 634 if (!converter.Convert(value, this)) { | 639 if (!converter.Convert(value, this)) { |
| 635 LOG(ERROR) << "Unable to parse: Invalid FileLabels"; | 640 LOG(ERROR) << "Unable to parse: Invalid FileLabels"; |
| 636 return false; | 641 return false; |
| 637 } | 642 } |
| 638 return true; | 643 return true; |
| 639 } | 644 } |
| 640 | 645 |
| 641 } // namespace gdata | 646 } // namespace gdata |
| OLD | NEW |