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

Side by Side Diff: chrome/browser/sync/glue/extension_sync_traits.h

Issue 6902054: [Sync] Rip out overly-complicated ExtensionData class (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed asargent's comments Created 9 years, 8 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) 2010 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 #ifndef CHROME_BROWSER_SYNC_GLUE_EXTENSION_SYNC_TRAITS_H_ 5 #ifndef CHROME_BROWSER_SYNC_GLUE_EXTENSION_SYNC_TRAITS_H_
6 #define CHROME_BROWSER_SYNC_GLUE_EXTENSION_SYNC_TRAITS_H_ 6 #define CHROME_BROWSER_SYNC_GLUE_EXTENSION_SYNC_TRAITS_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/sync/syncable/model_type.h" 9 #include "chrome/browser/sync/syncable/model_type.h"
10 10
11 class Extension; 11 class Extension;
(...skipping 30 matching lines...) Expand all
42 // successful. 42 // successful.
43 typedef bool (*ExtensionSpecificsEntityGetter)( 43 typedef bool (*ExtensionSpecificsEntityGetter)(
44 const sync_pb::EntitySpecifics&, sync_pb::ExtensionSpecifics*); 44 const sync_pb::EntitySpecifics&, sync_pb::ExtensionSpecifics*);
45 45
46 // Represents the properties needed for syncing data types that 46 // Represents the properties needed for syncing data types that
47 // involve extensions (e.g., "real" extensions, apps). 47 // involve extensions (e.g., "real" extensions, apps).
48 struct ExtensionSyncTraits { 48 struct ExtensionSyncTraits {
49 ExtensionSyncTraits( 49 ExtensionSyncTraits(
50 syncable::ModelType model_type, 50 syncable::ModelType model_type,
51 IsValidAndSyncablePredicate is_valid_and_syncable, 51 IsValidAndSyncablePredicate is_valid_and_syncable,
52 ShouldHandleExtensionUninstallPredicate
53 should_handle_extension_uninstall,
54 const char* root_node_tag, 52 const char* root_node_tag,
55 ExtensionSpecificsGetter extension_specifics_getter, 53 ExtensionSpecificsGetter extension_specifics_getter,
56 ExtensionSpecificsSetter extension_specifics_setter, 54 ExtensionSpecificsSetter extension_specifics_setter,
57 ExtensionSpecificsEntityGetter extension_specifics_entity_getter); 55 ExtensionSpecificsEntityGetter extension_specifics_entity_getter);
58 ~ExtensionSyncTraits(); 56 ~ExtensionSyncTraits();
59 57
60 // The sync type for the data type. 58 // The sync type for the data type.
61 const syncable::ModelType model_type; 59 const syncable::ModelType model_type;
62 // A checker to make sure that the downloaded extension is valid and 60 // A checker to make sure that the downloaded extension is valid and
63 // syncable. 61 // syncable.
64 const IsValidAndSyncablePredicate is_valid_and_syncable; 62 const IsValidAndSyncablePredicate is_valid_and_syncable;
65 // A checker to know which extension uninstall events to handle.
66 const ShouldHandleExtensionUninstallPredicate
67 should_handle_extension_uninstall;
68 // The tag with which the top-level data type node is marked. 63 // The tag with which the top-level data type node is marked.
69 const char* const root_node_tag; 64 const char* const root_node_tag;
70 // The function that retrieves a ExtensionSpecifics reference (which 65 // The function that retrieves a ExtensionSpecifics reference (which
71 // may be embedded in another specifics object) from a sync node. 66 // may be embedded in another specifics object) from a sync node.
72 const ExtensionSpecificsGetter extension_specifics_getter; 67 const ExtensionSpecificsGetter extension_specifics_getter;
73 // The function that embeds an ExtensionSpecifics into a sync node. 68 // The function that embeds an ExtensionSpecifics into a sync node.
74 const ExtensionSpecificsSetter extension_specifics_setter; 69 const ExtensionSpecificsSetter extension_specifics_setter;
75 // The function that retrieves a ExtensionSpecifics (if possible) 70 // The function that retrieves a ExtensionSpecifics (if possible)
76 // from an EntitySpecifics. 71 // from an EntitySpecifics.
77 ExtensionSpecificsEntityGetter extension_specifics_entity_getter; 72 ExtensionSpecificsEntityGetter extension_specifics_entity_getter;
78 }; 73 };
79 74
80 // Gets traits for extensions sync. 75 // Gets traits for extensions sync.
81 ExtensionSyncTraits GetExtensionSyncTraits(); 76 ExtensionSyncTraits GetExtensionSyncTraits();
82 77
83 // Gets traits for apps sync. 78 // Gets traits for apps sync.
84 ExtensionSyncTraits GetAppSyncTraits(); 79 ExtensionSyncTraits GetAppSyncTraits();
85 80
86 } // namespace browser_sync 81 } // namespace browser_sync
87 82
88 #endif // CHROME_BROWSER_SYNC_GLUE_EXTENSION_SYNC_TRAITS_H_ 83 #endif // CHROME_BROWSER_SYNC_GLUE_EXTENSION_SYNC_TRAITS_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/extension_sync.cc ('k') | chrome/browser/sync/glue/extension_sync_traits.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698