| 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/extensions/extension_sync_data.h" | 5 #include "chrome/browser/extensions/extension_sync_data.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/extensions/app_sync_data.h" | 8 #include "chrome/browser/extensions/app_sync_data.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/common/extensions/manifest_url_handler.h" | 10 #include "chrome/common/extensions/manifest_url_handler.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 specifics->set_incognito_enabled(incognito_enabled_); | 72 specifics->set_incognito_enabled(incognito_enabled_); |
| 73 specifics->set_name(name_); | 73 specifics->set_name(name_); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void ExtensionSyncData::PopulateFromExtensionSpecifics( | 76 void ExtensionSyncData::PopulateFromExtensionSpecifics( |
| 77 const sync_pb::ExtensionSpecifics& specifics) { | 77 const sync_pb::ExtensionSpecifics& specifics) { |
| 78 if (!Extension::IdIsValid(specifics.id())) { | 78 if (!Extension::IdIsValid(specifics.id())) { |
| 79 LOG(FATAL) << "Attempt to sync bad ExtensionSpecifics."; | 79 LOG(FATAL) << "Attempt to sync bad ExtensionSpecifics."; |
| 80 } | 80 } |
| 81 | 81 |
| 82 base::Version specifics_version(specifics.version()); | 82 Version specifics_version(specifics.version()); |
| 83 if (!specifics_version.IsValid()) | 83 if (!specifics_version.IsValid()) |
| 84 LOG(FATAL) << "Attempt to sync bad ExtensionSpecifics."; | 84 LOG(FATAL) << "Attempt to sync bad ExtensionSpecifics."; |
| 85 | 85 |
| 86 // The update URL must be either empty or valid. | 86 // The update URL must be either empty or valid. |
| 87 GURL specifics_update_url(specifics.update_url()); | 87 GURL specifics_update_url(specifics.update_url()); |
| 88 if (!specifics_update_url.is_empty() && !specifics_update_url.is_valid()) { | 88 if (!specifics_update_url.is_empty() && !specifics_update_url.is_valid()) { |
| 89 LOG(FATAL) << "Attempt to sync bad ExtensionSpecifics."; | 89 LOG(FATAL) << "Attempt to sync bad ExtensionSpecifics."; |
| 90 } | 90 } |
| 91 | 91 |
| 92 id_ = specifics.id(); | 92 id_ = specifics.id(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 106 const sync_pb::EntitySpecifics& entity_specifics = sync_data.GetSpecifics(); | 106 const sync_pb::EntitySpecifics& entity_specifics = sync_data.GetSpecifics(); |
| 107 | 107 |
| 108 if (entity_specifics.has_extension()) { | 108 if (entity_specifics.has_extension()) { |
| 109 PopulateFromExtensionSpecifics(entity_specifics.extension()); | 109 PopulateFromExtensionSpecifics(entity_specifics.extension()); |
| 110 } else { | 110 } else { |
| 111 LOG(FATAL) << "Attempt to sync bad EntitySpecifics."; | 111 LOG(FATAL) << "Attempt to sync bad EntitySpecifics."; |
| 112 } | 112 } |
| 113 } | 113 } |
| 114 | 114 |
| 115 } // namespace extensions | 115 } // namespace extensions |
| OLD | NEW |