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, | |
82 syncer::SyncChange::ACTION_ADD, | 81 syncer::SyncChange::ACTION_ADD, |
83 CreateData(extension_id, key, value, type)); | 82 CreateData(extension_id, key, value, type)); |
84 } | 83 } |
85 | 84 |
86 syncer::SyncChange CreateUpdate( | 85 syncer::SyncChange CreateUpdate( |
87 const std::string& extension_id, | 86 const std::string& extension_id, |
88 const std::string& key, | 87 const std::string& key, |
89 const Value& value, | 88 const Value& value, |
90 syncer::ModelType type) { | 89 syncer::ModelType type) { |
91 return syncer::SyncChange( | 90 return syncer::SyncChange( |
92 FROM_HERE, | |
93 syncer::SyncChange::ACTION_UPDATE, | 91 syncer::SyncChange::ACTION_UPDATE, |
94 CreateData(extension_id, key, value, type)); | 92 CreateData(extension_id, key, value, type)); |
95 } | 93 } |
96 | 94 |
97 syncer::SyncChange CreateDelete( | 95 syncer::SyncChange CreateDelete( |
98 const std::string& extension_id, | 96 const std::string& extension_id, |
99 const std::string& key, | 97 const std::string& key, |
100 syncer::ModelType type) { | 98 syncer::ModelType type) { |
101 DictionaryValue no_value; | 99 DictionaryValue no_value; |
102 return syncer::SyncChange( | 100 return syncer::SyncChange( |
103 FROM_HERE, | |
104 syncer::SyncChange::ACTION_DELETE, | 101 syncer::SyncChange::ACTION_DELETE, |
105 CreateData(extension_id, key, no_value, type)); | 102 CreateData(extension_id, key, no_value, type)); |
106 } | 103 } |
107 | 104 |
108 } // namespace settings_sync_util | 105 } // namespace settings_sync_util |
109 | 106 |
110 } // namespace extensions | 107 } // namespace extensions |
OLD | NEW |