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

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

Issue 1236363002: ExtensionSyncService cleanup: process uninstalls in one step (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review Created 5 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
« no previous file with comments | « chrome/browser/extensions/sync_bundle.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/sync_bundle.h" 5 #include "chrome/browser/extensions/sync_bundle.h"
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "chrome/browser/extensions/extension_sync_data.h" 8 #include "chrome/browser/extensions/extension_sync_data.h"
9 #include "chrome/browser/extensions/extension_sync_service.h" 9 #include "chrome/browser/extensions/extension_sync_service.h"
10 #include "chrome/browser/extensions/extension_util.h" 10 #include "chrome/browser/extensions/extension_util.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 void SyncBundle::PushSyncDeletion(const std::string& extension_id, 72 void SyncBundle::PushSyncDeletion(const std::string& extension_id,
73 const syncer::SyncData& sync_data) { 73 const syncer::SyncData& sync_data) {
74 RemoveSyncedExtension(extension_id); 74 RemoveSyncedExtension(extension_id);
75 PushSyncChanges(syncer::SyncChangeList(1, 75 PushSyncChanges(syncer::SyncChangeList(1,
76 syncer::SyncChange(FROM_HERE, 76 syncer::SyncChange(FROM_HERE,
77 syncer::SyncChange::ACTION_DELETE, 77 syncer::SyncChange::ACTION_DELETE,
78 sync_data))); 78 sync_data)));
79 } 79 }
80 80
81 void SyncBundle::PushSyncChangeIfNeeded(const Extension& extension) { 81 void SyncBundle::PushSyncAddOrUpdate(const Extension& extension) {
82 syncer::SyncChangeList sync_change_list( 82 syncer::SyncChangeList sync_change_list(
83 1, 83 1,
84 CreateSyncChange(extension.id(), 84 CreateSyncChange(extension.id(),
85 sync_service_->CreateSyncData(extension).GetSyncData())); 85 sync_service_->CreateSyncData(extension).GetSyncData()));
86 PushSyncChanges(sync_change_list); 86 PushSyncChanges(sync_change_list);
87 MarkPendingExtensionSynced(extension.id()); 87 MarkPendingExtensionSynced(extension.id());
88 } 88 }
89 89
90 void SyncBundle::ApplySyncChange(const syncer::SyncChange& sync_change) { 90 void SyncBundle::ApplySyncChange(const syncer::SyncChange& sync_change) {
91 scoped_ptr<ExtensionSyncData> extension_sync_data( 91 scoped_ptr<ExtensionSyncData> extension_sync_data(
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 void SyncBundle::RemoveSyncedExtension(const std::string& id) { 140 void SyncBundle::RemoveSyncedExtension(const std::string& id) {
141 synced_extensions_.erase(id); 141 synced_extensions_.erase(id);
142 } 142 }
143 143
144 void SyncBundle::MarkPendingExtensionSynced(const std::string& id) { 144 void SyncBundle::MarkPendingExtensionSynced(const std::string& id) {
145 pending_sync_data_.erase(id); 145 pending_sync_data_.erase(id);
146 AddSyncedExtension(id); 146 AddSyncedExtension(id);
147 } 147 }
148 148
149 } // namespace extensions 149 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/sync_bundle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698