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 #ifndef SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 std::string GetTitle() const; | 106 std::string GetTitle() const; |
107 | 107 |
108 // Returns the model type of this object. The model type is set at node | 108 // Returns the model type of this object. The model type is set at node |
109 // creation time and is expected never to change. | 109 // creation time and is expected never to change. |
110 ModelType GetModelType() const; | 110 ModelType GetModelType() const; |
111 | 111 |
112 // Getter specific to the BOOKMARK datatype. Returns protobuf | 112 // Getter specific to the BOOKMARK datatype. Returns protobuf |
113 // data. Can only be called if GetModelType() == BOOKMARK. | 113 // data. Can only be called if GetModelType() == BOOKMARK. |
114 const sync_pb::BookmarkSpecifics& GetBookmarkSpecifics() const; | 114 const sync_pb::BookmarkSpecifics& GetBookmarkSpecifics() const; |
115 | 115 |
116 // Legacy, bookmark-specific getter that wraps GetBookmarkSpecifics() above. | |
117 // Returns the URL of a bookmark object. | |
118 // TODO(ncarter): Remove this datatype-specific accessor. | |
119 GURL GetURL() const; | |
120 | |
121 // Legacy, bookmark-specific getter that wraps GetBookmarkSpecifics() above. | |
122 // Fill in a vector with the byte data of this node's favicon. Assumes | |
123 // that the node is a bookmark. | |
124 // Favicons are expected to be PNG images, and though no verification is | |
125 // done on the syncapi client of this, the server may reject favicon updates | |
126 // that are invalid for whatever reason. | |
127 // TODO(ncarter): Remove this datatype-specific accessor. | |
128 void GetFaviconBytes(std::vector<unsigned char>* output) const; | |
129 | |
130 // Getter specific to the APPS datatype. Returns protobuf | 116 // Getter specific to the APPS datatype. Returns protobuf |
131 // data. Can only be called if GetModelType() == APPS. | 117 // data. Can only be called if GetModelType() == APPS. |
132 const sync_pb::AppSpecifics& GetAppSpecifics() const; | 118 const sync_pb::AppSpecifics& GetAppSpecifics() const; |
133 | 119 |
134 // Getter specific to the AUTOFILL datatype. Returns protobuf | 120 // Getter specific to the AUTOFILL datatype. Returns protobuf |
135 // data. Can only be called if GetModelType() == AUTOFILL. | 121 // data. Can only be called if GetModelType() == AUTOFILL. |
136 const sync_pb::AutofillSpecifics& GetAutofillSpecifics() const; | 122 const sync_pb::AutofillSpecifics& GetAutofillSpecifics() const; |
137 | 123 |
138 virtual const sync_pb::AutofillProfileSpecifics& | 124 virtual const sync_pb::AutofillProfileSpecifics& |
139 GetAutofillProfileSpecifics() const; | 125 GetAutofillProfileSpecifics() const; |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 | 246 |
261 // Same as |unencrypted_data_|, but for legacy password encryption. | 247 // Same as |unencrypted_data_|, but for legacy password encryption. |
262 scoped_ptr<sync_pb::PasswordSpecificsData> password_data_; | 248 scoped_ptr<sync_pb::PasswordSpecificsData> password_data_; |
263 | 249 |
264 DISALLOW_COPY_AND_ASSIGN(BaseNode); | 250 DISALLOW_COPY_AND_ASSIGN(BaseNode); |
265 }; | 251 }; |
266 | 252 |
267 } // namespace syncer | 253 } // namespace syncer |
268 | 254 |
269 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ | 255 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ |
OLD | NEW |