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

Side by Side Diff: chrome/browser/extensions/extension_sync_data.h

Issue 10698014: [Sync] Rename csync namespace to syncer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 5 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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SYNC_DATA_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SYNC_DATA_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYNC_DATA_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SYNC_DATA_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 10
11 #include "base/version.h" 11 #include "base/version.h"
12 #include "chrome/common/string_ordinal.h" 12 #include "chrome/common/string_ordinal.h"
13 #include "googleurl/src/gurl.h" 13 #include "googleurl/src/gurl.h"
14 #include "sync/api/sync_change.h" 14 #include "sync/api/sync_change.h"
15 15
16 namespace csync { 16 namespace syncer {
17 class SyncData; 17 class SyncData;
18 } 18 }
19 19
20 namespace sync_pb { 20 namespace sync_pb {
21 class ExtensionSpecifics; 21 class ExtensionSpecifics;
22 } 22 }
23 23
24 namespace extensions { 24 namespace extensions {
25 25
26 class Extension; 26 class Extension;
27 27
28 // A class that encapsulates the synced properties of an Extension. 28 // A class that encapsulates the synced properties of an Extension.
29 class ExtensionSyncData { 29 class ExtensionSyncData {
30 public: 30 public:
31 ExtensionSyncData(); 31 ExtensionSyncData();
32 explicit ExtensionSyncData(const csync::SyncData& sync_data); 32 explicit ExtensionSyncData(const syncer::SyncData& sync_data);
33 explicit ExtensionSyncData(const csync::SyncChange& sync_change); 33 explicit ExtensionSyncData(const syncer::SyncChange& sync_change);
34 ExtensionSyncData(const Extension& extension, 34 ExtensionSyncData(const Extension& extension,
35 bool enabled, 35 bool enabled,
36 bool incognito_enabled); 36 bool incognito_enabled);
37 ~ExtensionSyncData(); 37 ~ExtensionSyncData();
38 38
39 // Retrieve sync data from this class. 39 // Retrieve sync data from this class.
40 csync::SyncData GetSyncData() const; 40 syncer::SyncData GetSyncData() const;
41 csync::SyncChange GetSyncChange( 41 syncer::SyncChange GetSyncChange(
42 csync::SyncChange::SyncChangeType change_type) const; 42 syncer::SyncChange::SyncChangeType change_type) const;
43 43
44 // Convert an ExtensionSyncData back out to a sync structure. 44 // Convert an ExtensionSyncData back out to a sync structure.
45 void PopulateExtensionSpecifics(sync_pb::ExtensionSpecifics* specifics) const; 45 void PopulateExtensionSpecifics(sync_pb::ExtensionSpecifics* specifics) const;
46 46
47 // Populate this class from sync inputs. 47 // Populate this class from sync inputs.
48 void PopulateFromExtensionSpecifics( 48 void PopulateFromExtensionSpecifics(
49 const sync_pb::ExtensionSpecifics& specifics); 49 const sync_pb::ExtensionSpecifics& specifics);
50 50
51 void set_uninstalled(bool uninstalled); 51 void set_uninstalled(bool uninstalled);
52 52
53 const std::string& id() const { return id_; } 53 const std::string& id() const { return id_; }
54 54
55 // Version-independent properties (i.e., used even when the 55 // Version-independent properties (i.e., used even when the
56 // version of the currently-installed extension doesn't match 56 // version of the currently-installed extension doesn't match
57 // |version|). 57 // |version|).
58 bool uninstalled() const { return uninstalled_; } 58 bool uninstalled() const { return uninstalled_; }
59 bool enabled() const { return enabled_; } 59 bool enabled() const { return enabled_; }
60 bool incognito_enabled() const { return incognito_enabled_; } 60 bool incognito_enabled() const { return incognito_enabled_; }
61 61
62 // Version-dependent properties (i.e., should be used only when the 62 // Version-dependent properties (i.e., should be used only when the
63 // version of the currenty-installed extension matches |version|). 63 // version of the currenty-installed extension matches |version|).
64 const Version& version() const { return version_; } 64 const Version& version() const { return version_; }
65 const GURL& update_url() const { return update_url_; } 65 const GURL& update_url() const { return update_url_; }
66 // Used only for debugging. 66 // Used only for debugging.
67 const std::string& name() const { return name_; } 67 const std::string& name() const { return name_; }
68 68
69 private: 69 private:
70 // Populate this class from sync inputs. 70 // Populate this class from sync inputs.
71 void PopulateFromSyncData(const csync::SyncData& sync_data); 71 void PopulateFromSyncData(const syncer::SyncData& sync_data);
72 72
73 std::string id_; 73 std::string id_;
74 bool uninstalled_; 74 bool uninstalled_;
75 bool enabled_; 75 bool enabled_;
76 bool incognito_enabled_; 76 bool incognito_enabled_;
77 Version version_; 77 Version version_;
78 GURL update_url_; 78 GURL update_url_;
79 std::string name_; 79 std::string name_;
80 }; 80 };
81 81
82 } // namespace extensions 82 } // namespace extensions
83 83
84 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYNC_DATA_H_ 84 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SYNC_DATA_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_sync_bundle.cc ('k') | chrome/browser/extensions/extension_sync_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698