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/api/storage/setting_sync_data.h" | 5 #include "chrome/browser/extensions/api/storage/setting_sync_data.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
11 #include "sync/api/sync_data.h" | 11 #include "components/sync/api/sync_data.h" |
12 #include "sync/protocol/app_setting_specifics.pb.h" | 12 #include "components/sync/protocol/app_setting_specifics.pb.h" |
13 #include "sync/protocol/extension_setting_specifics.pb.h" | 13 #include "components/sync/protocol/extension_setting_specifics.pb.h" |
14 #include "sync/protocol/sync.pb.h" | 14 #include "components/sync/protocol/sync.pb.h" |
15 | 15 |
16 namespace extensions { | 16 namespace extensions { |
17 | 17 |
18 SettingSyncData::SettingSyncData(const syncer::SyncChange& sync_change) | 18 SettingSyncData::SettingSyncData(const syncer::SyncChange& sync_change) |
19 : change_type_(sync_change.change_type()) { | 19 : change_type_(sync_change.change_type()) { |
20 ExtractSyncData(sync_change.sync_data()); | 20 ExtractSyncData(sync_change.sync_data()); |
21 } | 21 } |
22 | 22 |
23 SettingSyncData::SettingSyncData(const syncer::SyncData& sync_data) | 23 SettingSyncData::SettingSyncData(const syncer::SyncData& sync_data) |
24 : change_type_(syncer::SyncChange::ACTION_INVALID) { | 24 : change_type_(syncer::SyncChange::ACTION_INVALID) { |
(...skipping 30 matching lines...) Expand all Loading... |
55 value_ = base::JSONReader::Read(extension_specifics.value()); | 55 value_ = base::JSONReader::Read(extension_specifics.value()); |
56 | 56 |
57 if (!value_) { | 57 if (!value_) { |
58 LOG(WARNING) << "Specifics for " << extension_id_ << "/" << key_ | 58 LOG(WARNING) << "Specifics for " << extension_id_ << "/" << key_ |
59 << " had bad JSON for value: " << extension_specifics.value(); | 59 << " had bad JSON for value: " << extension_specifics.value(); |
60 value_.reset(new base::DictionaryValue()); | 60 value_.reset(new base::DictionaryValue()); |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
64 } // namespace extensions | 64 } // namespace extensions |
OLD | NEW |