Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: chrome/browser/extensions/app_sync_data.cc

Issue 10920017: [Sync] Generalize StringOrdinal to handle ordinal_in_parent field (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix another compile error Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 12 matching lines...) Expand all
23 PopulateFromSyncData(sync_change.sync_data()); 23 PopulateFromSyncData(sync_change.sync_data());
24 extension_sync_data_.set_uninstalled( 24 extension_sync_data_.set_uninstalled(
25 sync_change.change_type() == syncer::SyncChange::ACTION_DELETE); 25 sync_change.change_type() == syncer::SyncChange::ACTION_DELETE);
26 } 26 }
27 27
28 AppSyncData::AppSyncData(const Extension& extension, 28 AppSyncData::AppSyncData(const Extension& extension,
29 bool enabled, 29 bool enabled,
30 bool incognito_enabled, 30 bool incognito_enabled,
31 const std::string& notifications_client_id, 31 const std::string& notifications_client_id,
32 bool notifications_disabled, 32 bool notifications_disabled,
33 const StringOrdinal& app_launch_ordinal, 33 const syncer::StringOrdinal& app_launch_ordinal,
34 const StringOrdinal& page_ordinal) 34 const syncer::StringOrdinal& page_ordinal)
35 : extension_sync_data_(extension, enabled, incognito_enabled), 35 : extension_sync_data_(extension, enabled, incognito_enabled),
36 notifications_client_id_(notifications_client_id), 36 notifications_client_id_(notifications_client_id),
37 notifications_disabled_(notifications_disabled), 37 notifications_disabled_(notifications_disabled),
38 app_launch_ordinal_(app_launch_ordinal), 38 app_launch_ordinal_(app_launch_ordinal),
39 page_ordinal_(page_ordinal) { 39 page_ordinal_(page_ordinal) {
40 } 40 }
41 41
42 AppSyncData::~AppSyncData() {} 42 AppSyncData::~AppSyncData() {}
43 43
44 syncer::SyncData AppSyncData::GetSyncData() const { 44 syncer::SyncData AppSyncData::GetSyncData() const {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 specifics.notification_settings().has_oauth_client_id()) { 81 specifics.notification_settings().has_oauth_client_id()) {
82 notifications_client_id_ = 82 notifications_client_id_ =
83 specifics.notification_settings().oauth_client_id(); 83 specifics.notification_settings().oauth_client_id();
84 } 84 }
85 85
86 notifications_disabled_ = 86 notifications_disabled_ =
87 specifics.has_notification_settings() && 87 specifics.has_notification_settings() &&
88 specifics.notification_settings().has_disabled() && 88 specifics.notification_settings().has_disabled() &&
89 specifics.notification_settings().disabled(); 89 specifics.notification_settings().disabled();
90 90
91 app_launch_ordinal_ = StringOrdinal(specifics.app_launch_ordinal()); 91 app_launch_ordinal_ = syncer::StringOrdinal(specifics.app_launch_ordinal());
92 page_ordinal_ = StringOrdinal(specifics.page_ordinal()); 92 page_ordinal_ = syncer::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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698