OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 | 206 |
207 // Returns this item's position within its parent. | 207 // Returns this item's position within its parent. |
208 // Do not call this function on items that do not support positioning | 208 // Do not call this function on items that do not support positioning |
209 // (ie. non-bookmarks). | 209 // (ie. non-bookmarks). |
210 int GetPositionIndex() const; | 210 int GetPositionIndex() const; |
211 | 211 |
212 // These virtual accessors provide access to data members of derived classes. | 212 // These virtual accessors provide access to data members of derived classes. |
213 virtual const syncable::Entry* GetEntry() const = 0; | 213 virtual const syncable::Entry* GetEntry() const = 0; |
214 virtual const BaseTransaction* GetTransaction() const = 0; | 214 virtual const BaseTransaction* GetTransaction() const = 0; |
215 | 215 |
216 // Dumps a summary of node info into a DictionaryValue and returns it. | 216 // Returns a base::DictionaryValue serialization of this node. |
217 // Transfers ownership of the DictionaryValue to the caller. | 217 base::DictionaryValue* ToValue() const; |
218 base::DictionaryValue* GetSummaryAsValue() const; | |
219 | |
220 // Dumps all node details into a DictionaryValue and returns it. | |
221 // Transfers ownership of the DictionaryValue to the caller. | |
222 base::DictionaryValue* GetDetailsAsValue() const; | |
223 | 218 |
224 protected: | 219 protected: |
225 BaseNode(); | 220 BaseNode(); |
226 virtual ~BaseNode(); | 221 virtual ~BaseNode(); |
227 | 222 |
228 // Determines whether part of the entry is encrypted, and if so attempts to | 223 // Determines whether part of the entry is encrypted, and if so attempts to |
229 // decrypt it. Unless decryption is necessary and fails, this will always | 224 // decrypt it. Unless decryption is necessary and fails, this will always |
230 // return |true|. If the contents are encrypted, the decrypted data will be | 225 // return |true|. If the contents are encrypted, the decrypted data will be |
231 // stored in |unencrypted_data_|. | 226 // stored in |unencrypted_data_|. |
232 // This method is invoked once when the BaseNode is initialized. | 227 // This method is invoked once when the BaseNode is initialized. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 | 261 |
267 // Same as |unencrypted_data_|, but for legacy password encryption. | 262 // Same as |unencrypted_data_|, but for legacy password encryption. |
268 scoped_ptr<sync_pb::PasswordSpecificsData> password_data_; | 263 scoped_ptr<sync_pb::PasswordSpecificsData> password_data_; |
269 | 264 |
270 DISALLOW_COPY_AND_ASSIGN(BaseNode); | 265 DISALLOW_COPY_AND_ASSIGN(BaseNode); |
271 }; | 266 }; |
272 | 267 |
273 } // namespace syncer | 268 } // namespace syncer |
274 | 269 |
275 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ | 270 #endif // SYNC_INTERNAL_API_PUBLIC_BASE_NODE_H_ |
OLD | NEW |