| 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/settings/settings_sync_util.h" | 5 #include "chrome/browser/extensions/settings/settings_sync_util.h" |
| 6 | 6 |
| 7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "sync/protocol/app_setting_specifics.pb.h" | 9 #include "sync/protocol/app_setting_specifics.pb.h" |
| 10 #include "sync/protocol/extension_setting_specifics.pb.h" | 10 #include "sync/protocol/extension_setting_specifics.pb.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 return syncer::SyncData::CreateLocalData( | 71 return syncer::SyncData::CreateLocalData( |
| 72 extension_id + "/" + key, key, specifics); | 72 extension_id + "/" + key, key, specifics); |
| 73 } | 73 } |
| 74 | 74 |
| 75 syncer::SyncChange CreateAdd( | 75 syncer::SyncChange CreateAdd( |
| 76 const std::string& extension_id, | 76 const std::string& extension_id, |
| 77 const std::string& key, | 77 const std::string& key, |
| 78 const Value& value, | 78 const Value& value, |
| 79 syncer::ModelType type) { | 79 syncer::ModelType type) { |
| 80 return syncer::SyncChange( | 80 return syncer::SyncChange( |
| 81 FROM_HERE, |
| 81 syncer::SyncChange::ACTION_ADD, | 82 syncer::SyncChange::ACTION_ADD, |
| 82 CreateData(extension_id, key, value, type)); | 83 CreateData(extension_id, key, value, type)); |
| 83 } | 84 } |
| 84 | 85 |
| 85 syncer::SyncChange CreateUpdate( | 86 syncer::SyncChange CreateUpdate( |
| 86 const std::string& extension_id, | 87 const std::string& extension_id, |
| 87 const std::string& key, | 88 const std::string& key, |
| 88 const Value& value, | 89 const Value& value, |
| 89 syncer::ModelType type) { | 90 syncer::ModelType type) { |
| 90 return syncer::SyncChange( | 91 return syncer::SyncChange( |
| 92 FROM_HERE, |
| 91 syncer::SyncChange::ACTION_UPDATE, | 93 syncer::SyncChange::ACTION_UPDATE, |
| 92 CreateData(extension_id, key, value, type)); | 94 CreateData(extension_id, key, value, type)); |
| 93 } | 95 } |
| 94 | 96 |
| 95 syncer::SyncChange CreateDelete( | 97 syncer::SyncChange CreateDelete( |
| 96 const std::string& extension_id, | 98 const std::string& extension_id, |
| 97 const std::string& key, | 99 const std::string& key, |
| 98 syncer::ModelType type) { | 100 syncer::ModelType type) { |
| 99 DictionaryValue no_value; | 101 DictionaryValue no_value; |
| 100 return syncer::SyncChange( | 102 return syncer::SyncChange( |
| 103 FROM_HERE, |
| 101 syncer::SyncChange::ACTION_DELETE, | 104 syncer::SyncChange::ACTION_DELETE, |
| 102 CreateData(extension_id, key, no_value, type)); | 105 CreateData(extension_id, key, no_value, type)); |
| 103 } | 106 } |
| 104 | 107 |
| 105 } // namespace settings_sync_util | 108 } // namespace settings_sync_util |
| 106 | 109 |
| 107 } // namespace extensions | 110 } // namespace extensions |
| OLD | NEW |