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/app_sync_data.h" | 5 #include "chrome/browser/extensions/app_sync_data.h" |
6 | 6 |
7 #include "chrome/common/extensions/extension.h" | 7 #include "chrome/common/extensions/extension.h" |
8 #include "sync/api/sync_data.h" | 8 #include "sync/api/sync_data.h" |
9 #include "sync/protocol/app_specifics.pb.h" | 9 #include "sync/protocol/app_specifics.pb.h" |
10 #include "sync/protocol/sync.pb.h" | 10 #include "sync/protocol/sync.pb.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 sync_pb::EntitySpecifics specifics; | 45 sync_pb::EntitySpecifics specifics; |
46 PopulateAppSpecifics(specifics.mutable_app()); | 46 PopulateAppSpecifics(specifics.mutable_app()); |
47 | 47 |
48 return syncer::SyncData::CreateLocalData(extension_sync_data_.id(), | 48 return syncer::SyncData::CreateLocalData(extension_sync_data_.id(), |
49 extension_sync_data_.name(), | 49 extension_sync_data_.name(), |
50 specifics); | 50 specifics); |
51 } | 51 } |
52 | 52 |
53 syncer::SyncChange AppSyncData::GetSyncChange( | 53 syncer::SyncChange AppSyncData::GetSyncChange( |
54 syncer::SyncChange::SyncChangeType change_type) const { | 54 syncer::SyncChange::SyncChangeType change_type) const { |
55 return syncer::SyncChange(change_type, GetSyncData()); | 55 return syncer::SyncChange(FROM_HERE, change_type, GetSyncData()); |
56 } | 56 } |
57 | 57 |
58 void AppSyncData::PopulateAppSpecifics(sync_pb::AppSpecifics* specifics) const { | 58 void AppSyncData::PopulateAppSpecifics(sync_pb::AppSpecifics* specifics) const { |
59 DCHECK(specifics); | 59 DCHECK(specifics); |
60 sync_pb::AppNotificationSettings* notification_settings = | 60 sync_pb::AppNotificationSettings* notification_settings = |
61 specifics->mutable_notification_settings(); | 61 specifics->mutable_notification_settings(); |
62 if (!notifications_client_id_.empty()) | 62 if (!notifications_client_id_.empty()) |
63 notification_settings->set_oauth_client_id(notifications_client_id_); | 63 notification_settings->set_oauth_client_id(notifications_client_id_); |
64 notification_settings->set_disabled(notifications_disabled_); | 64 notification_settings->set_disabled(notifications_disabled_); |
65 | 65 |
(...skipping 24 matching lines...) Expand all Loading... |
90 | 90 |
91 app_launch_ordinal_ = StringOrdinal(specifics.app_launch_ordinal()); | 91 app_launch_ordinal_ = StringOrdinal(specifics.app_launch_ordinal()); |
92 page_ordinal_ = StringOrdinal(specifics.page_ordinal()); | 92 page_ordinal_ = StringOrdinal(specifics.page_ordinal()); |
93 } | 93 } |
94 | 94 |
95 void AppSyncData::PopulateFromSyncData(const syncer::SyncData& sync_data) { | 95 void AppSyncData::PopulateFromSyncData(const syncer::SyncData& sync_data) { |
96 PopulateFromAppSpecifics(sync_data.GetSpecifics().app()); | 96 PopulateFromAppSpecifics(sync_data.GetSpecifics().app()); |
97 } | 97 } |
98 | 98 |
99 } // namespace extensions | 99 } // namespace extensions |
OLD | NEW |