OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_SYNC_GLUE_EXTENSION_UTIL_H_ | |
6 #define CHROME_BROWSER_SYNC_GLUE_EXTENSION_UTIL_H_ | |
7 #pragma once | |
8 | |
9 // This file contains some low-level utility functions used by | |
10 // extensions sync. | |
11 | |
12 #include <string> | |
13 | |
14 class Extension; | |
15 struct ExtensionSyncData; | |
16 | |
17 namespace sync_pb { | |
18 class ExtensionSpecifics; | |
19 } // sync_pb | |
20 | |
21 namespace browser_sync { | |
22 | |
23 // Returns whether or not the given extension is one we want to sync. | |
24 bool IsExtensionValid(const Extension& extension); | |
25 | |
26 // Stringifies the given ExtensionSpecifics. | |
27 std::string ExtensionSpecificsToString( | |
28 const sync_pb::ExtensionSpecifics& specifics); | |
29 | |
30 // Fills |sync_data| with the data from |specifics|. Returns true iff | |
31 // succesful. | |
32 bool SpecificsToSyncData( | |
33 const sync_pb::ExtensionSpecifics& specifics, | |
34 ExtensionSyncData* sync_data); | |
35 | |
36 // Fills |specifics| with the data from |sync_data|. | |
37 void SyncDataToSpecifics( | |
38 const ExtensionSyncData& sync_data, | |
39 sync_pb::ExtensionSpecifics* specifics); | |
40 | |
41 } // namespace browser_sync | |
42 | |
43 #endif // CHROME_BROWSER_SYNC_GLUE_EXTENSION_UTIL_H_ | |
OLD | NEW |