OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/sync/protocol/app_specifics.pb.h" | 9 #include "chrome/browser/sync/protocol/app_specifics.pb.h" |
10 #include "chrome/browser/sync/protocol/extension_specifics.pb.h" | 10 #include "chrome/browser/sync/protocol/extension_specifics.pb.h" |
11 | 11 |
12 ExtensionSyncData::ExtensionSyncData() | 12 ExtensionSyncData::ExtensionSyncData() |
13 : uninstalled_(false), | 13 : uninstalled_(false), |
14 enabled_(false), | 14 enabled_(false), |
15 incognito_enabled_(false), | 15 incognito_enabled_(false), |
16 type_(Extension::SYNC_TYPE_NONE), | 16 type_(Extension::SYNC_TYPE_NONE), |
17 notifications_disabled_(false) { | 17 notifications_disabled_(false) { |
18 } | 18 } |
19 | 19 |
20 ExtensionSyncData::ExtensionSyncData(const SyncData& sync_data) | 20 ExtensionSyncData::ExtensionSyncData(const SyncData& sync_data) |
21 : uninstalled_(false), | 21 : uninstalled_(false), |
22 enabled_(false), | 22 enabled_(false), |
23 incognito_enabled_(false), | 23 incognito_enabled_(false), |
24 type_(Extension::SYNC_TYPE_NONE), | 24 type_(Extension::SYNC_TYPE_NONE), |
25 notifications_disabled_(false) { | 25 notifications_disabled_(false) { |
26 PopulateFromSyncData(sync_data); | 26 PopulateFromSyncData(sync_data); |
27 } | 27 } |
28 | 28 |
29 ExtensionSyncData::ExtensionSyncData(const SyncChange& sync_change) | 29 ExtensionSyncData::ExtensionSyncData(const SyncChange& sync_change) |
30 : uninstalled_(sync_change.change_type() == SyncChange::ACTION_DELETE) { | 30 : uninstalled_(sync_change.change_type() == SyncChange::ACTION_DELETE), |
| 31 enabled_(false), |
| 32 incognito_enabled_(false), |
| 33 type_(Extension::SYNC_TYPE_NONE), |
| 34 notifications_disabled_(false) { |
31 PopulateFromSyncData(sync_change.sync_data()); | 35 PopulateFromSyncData(sync_change.sync_data()); |
32 } | 36 } |
33 | 37 |
34 ExtensionSyncData::ExtensionSyncData(const Extension& extension, | 38 ExtensionSyncData::ExtensionSyncData(const Extension& extension, |
35 bool enabled, | 39 bool enabled, |
36 bool incognito_enabled, | 40 bool incognito_enabled, |
37 const std::string& notifications_client_id, | 41 const std::string& notifications_client_id, |
38 bool notifications_disabled) | 42 bool notifications_disabled) |
39 : id_(extension.id()), | 43 : id_(extension.id()), |
40 uninstalled_(false), | 44 uninstalled_(false), |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 141 |
138 notifications_disabled_ = | 142 notifications_disabled_ = |
139 app_specifics.has_notification_settings() && | 143 app_specifics.has_notification_settings() && |
140 app_specifics.notification_settings().has_disabled() && | 144 app_specifics.notification_settings().has_disabled() && |
141 app_specifics.notification_settings().disabled(); | 145 app_specifics.notification_settings().disabled(); |
142 } else { | 146 } else { |
143 LOG(FATAL) << "Attempt to sync bad EntitySpecifics."; | 147 LOG(FATAL) << "Attempt to sync bad EntitySpecifics."; |
144 } | 148 } |
145 PopulateFromExtensionSpecifics(extension_expecifics); | 149 PopulateFromExtensionSpecifics(extension_expecifics); |
146 } | 150 } |
OLD | NEW |