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

Side by Side Diff: chrome/browser/extensions/extension_sync_data.cc

Issue 10766016: [Sync] Add location parameter to SyncChange in Sync API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: F Created 8 years, 5 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 | Annotate | Revision Log
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 #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/extension.h" 10 #include "chrome/common/extensions/extension.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 syncer::SyncData ExtensionSyncData::GetSyncData() const { 52 syncer::SyncData ExtensionSyncData::GetSyncData() const {
53 sync_pb::EntitySpecifics specifics; 53 sync_pb::EntitySpecifics specifics;
54 PopulateExtensionSpecifics(specifics.mutable_extension()); 54 PopulateExtensionSpecifics(specifics.mutable_extension());
55 55
56 return syncer::SyncData::CreateLocalData(id_, name_, specifics); 56 return syncer::SyncData::CreateLocalData(id_, name_, specifics);
57 } 57 }
58 58
59 syncer::SyncChange ExtensionSyncData::GetSyncChange( 59 syncer::SyncChange ExtensionSyncData::GetSyncChange(
60 syncer::SyncChange::SyncChangeType change_type) const { 60 syncer::SyncChange::SyncChangeType change_type) const {
61 return syncer::SyncChange(change_type, GetSyncData()); 61 return syncer::SyncChange(FROM_HERE, change_type, GetSyncData());
62 } 62 }
63 63
64 void ExtensionSyncData::PopulateExtensionSpecifics( 64 void ExtensionSyncData::PopulateExtensionSpecifics(
65 sync_pb::ExtensionSpecifics* specifics) const { 65 sync_pb::ExtensionSpecifics* specifics) const {
66 DCHECK(Extension::IdIsValid(id_)); 66 DCHECK(Extension::IdIsValid(id_));
67 specifics->set_id(id_); 67 specifics->set_id(id_);
68 specifics->set_update_url(update_url_.spec()); 68 specifics->set_update_url(update_url_.spec());
69 specifics->set_version(version_.GetString()); 69 specifics->set_version(version_.GetString());
70 specifics->set_enabled(enabled_); 70 specifics->set_enabled(enabled_);
71 specifics->set_incognito_enabled(incognito_enabled_); 71 specifics->set_incognito_enabled(incognito_enabled_);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 const sync_pb::EntitySpecifics& entity_specifics = sync_data.GetSpecifics(); 105 const sync_pb::EntitySpecifics& entity_specifics = sync_data.GetSpecifics();
106 106
107 if (entity_specifics.has_extension()) { 107 if (entity_specifics.has_extension()) {
108 PopulateFromExtensionSpecifics(entity_specifics.extension()); 108 PopulateFromExtensionSpecifics(entity_specifics.extension());
109 } else { 109 } else {
110 LOG(FATAL) << "Attempt to sync bad EntitySpecifics."; 110 LOG(FATAL) << "Attempt to sync bad EntitySpecifics.";
111 } 111 }
112 } 112 }
113 113
114 } // namespace extensions 114 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698