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 "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 // Only sync the ordinal values and launch type if they are valid. | 195 // Only sync the ordinal values and launch type if they are valid. |
196 if (app_launch_ordinal_.IsValid()) | 196 if (app_launch_ordinal_.IsValid()) |
197 specifics->set_app_launch_ordinal(app_launch_ordinal_.ToInternalValue()); | 197 specifics->set_app_launch_ordinal(app_launch_ordinal_.ToInternalValue()); |
198 if (page_ordinal_.IsValid()) | 198 if (page_ordinal_.IsValid()) |
199 specifics->set_page_ordinal(page_ordinal_.ToInternalValue()); | 199 specifics->set_page_ordinal(page_ordinal_.ToInternalValue()); |
200 | 200 |
201 sync_pb::AppSpecifics::LaunchType sync_launch_type = | 201 sync_pb::AppSpecifics::LaunchType sync_launch_type = |
202 static_cast<sync_pb::AppSpecifics::LaunchType>(launch_type_); | 202 static_cast<sync_pb::AppSpecifics::LaunchType>(launch_type_); |
203 | 203 |
204 // The corresponding validation of this value during processing of an | 204 // The corresponding validation of this value during processing of an |
205 // AppSyncData is in ExtensionSyncService::ProcessAppSyncData. | 205 // ExtensionSyncData is in ExtensionSyncService::ApplySyncData. |
206 if (launch_type_ >= LAUNCH_TYPE_FIRST && launch_type_ < NUM_LAUNCH_TYPES && | 206 if (launch_type_ >= LAUNCH_TYPE_FIRST && launch_type_ < NUM_LAUNCH_TYPES && |
207 sync_pb::AppSpecifics_LaunchType_IsValid(sync_launch_type)) { | 207 sync_pb::AppSpecifics_LaunchType_IsValid(sync_launch_type)) { |
208 specifics->set_launch_type(sync_launch_type); | 208 specifics->set_launch_type(sync_launch_type); |
209 } | 209 } |
210 | 210 |
211 if (!bookmark_app_url_.empty()) | 211 if (!bookmark_app_url_.empty()) |
212 specifics->set_bookmark_app_url(bookmark_app_url_); | 212 specifics->set_bookmark_app_url(bookmark_app_url_); |
213 | 213 |
214 if (!bookmark_app_description_.empty()) | 214 if (!bookmark_app_description_.empty()) |
215 specifics->set_bookmark_app_description(bookmark_app_description_); | 215 specifics->set_bookmark_app_description(bookmark_app_description_); |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 | 330 |
331 if (entity_specifics.has_extension()) | 331 if (entity_specifics.has_extension()) |
332 return PopulateFromExtensionSpecifics(entity_specifics.extension()); | 332 return PopulateFromExtensionSpecifics(entity_specifics.extension()); |
333 | 333 |
334 LOG(ERROR) << "Attempt to sync bad EntitySpecifics: no extension data."; | 334 LOG(ERROR) << "Attempt to sync bad EntitySpecifics: no extension data."; |
335 RecordBadSyncData(NO_EXTENSION_SPECIFICS); | 335 RecordBadSyncData(NO_EXTENSION_SPECIFICS); |
336 return false; | 336 return false; |
337 } | 337 } |
338 | 338 |
339 } // namespace extensions | 339 } // namespace extensions |
OLD | NEW |