| 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 CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 | 300 |
| 301 // Adds child file to the directory and takes over the ownership of |file| | 301 // Adds child file to the directory and takes over the ownership of |file| |
| 302 // object. The method will also do name de-duplication to ensure that the | 302 // object. The method will also do name de-duplication to ensure that the |
| 303 // exposed presentation path does not have naming conflicts. Two files with | 303 // exposed presentation path does not have naming conflicts. Two files with |
| 304 // the same name "Foo" will be renames to "Foo (1)" and "Foo (2)". | 304 // the same name "Foo" will be renames to "Foo (1)" and "Foo (2)". |
| 305 // TODO(satorux): Remove this. crbug.com/139649 | 305 // TODO(satorux): Remove this. crbug.com/139649 |
| 306 void AddEntry(GDataEntry* entry); | 306 void AddEntry(GDataEntry* entry); |
| 307 | 307 |
| 308 // Removes the entry from its children list and destroys the entry instance. | 308 // Removes the entry from its children list and destroys the entry instance. |
| 309 // TODO(satorux): Remove this. crbug.com/139649 | 309 // TODO(satorux): Remove this. crbug.com/139649 |
| 310 bool RemoveEntry(GDataEntry* entry); | 310 void RemoveEntry(GDataEntry* entry); |
| 311 | 311 |
| 312 // Takes the ownership of |entry| from its current parent. If this directory | 312 // Takes the ownership of |entry| from its current parent. If this directory |
| 313 // is already the current parent of |file|, this method effectively goes | 313 // is already the current parent of |file|, this method effectively goes |
| 314 // through the name de-duplication for |file| based on the current state of | 314 // through the name de-duplication for |file| based on the current state of |
| 315 // the file system. | 315 // the file system. |
| 316 // TODO(satorux): Remove this. crbug.com/139649 | 316 // TODO(satorux): Remove this. crbug.com/139649 |
| 317 bool TakeEntry(GDataEntry* entry); | 317 bool TakeEntry(GDataEntry* entry); |
| 318 | 318 |
| 319 // Takes over all entries from |dir|. | 319 // Takes over all entries from |dir|. |
| 320 // TODO(satorux): Remove this. crbug.com/139649 | 320 // TODO(satorux): Remove this. crbug.com/139649 |
| 321 bool TakeOverEntries(GDataDirectory* dir); | 321 bool TakeOverEntries(GDataDirectory* dir); |
| 322 | 322 |
| 323 // Find a child by its name. | 323 // Find a child by its name. |
| 324 // TODO(satorux): Remove this. crbug.com/139649 | 324 // TODO(satorux): Remove this. crbug.com/139649 |
| 325 GDataEntry* FindChild(const FilePath::StringType& file_name) const; | 325 GDataEntry* FindChild(const FilePath::StringType& file_name) const; |
| 326 | 326 |
| 327 // Add |entry| to children. | 327 // Add |entry| to children. |
| 328 void AddChild(GDataEntry* entry); | 328 void AddChild(GDataEntry* entry); |
| 329 | 329 |
| 330 // Removes the entry from its children without destroying the | 330 // Removes the entry from its children without destroying the |
| 331 // entry instance. | 331 // entry instance. |
| 332 bool RemoveChild(GDataEntry* entry); | 332 void RemoveChild(GDataEntry* entry); |
| 333 | 333 |
| 334 // Collection of children GDataEntry items. | 334 // Collection of children GDataEntry items. |
| 335 GDataFileCollection child_files_; | 335 GDataFileCollection child_files_; |
| 336 GDataDirectoryCollection child_directories_; | 336 GDataDirectoryCollection child_directories_; |
| 337 | 337 |
| 338 DISALLOW_COPY_AND_ASSIGN(GDataDirectory); | 338 DISALLOW_COPY_AND_ASSIGN(GDataDirectory); |
| 339 }; | 339 }; |
| 340 | 340 |
| 341 // TODO(achuith,hashimoto,satorux): Move this to a separate file. | 341 // TODO(achuith,hashimoto,satorux): Move this to a separate file. |
| 342 // crbug.com/140317. | 342 // crbug.com/140317. |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 // This should remain the last member so it'll be destroyed first and | 450 // This should remain the last member so it'll be destroyed first and |
| 451 // invalidate its weak pointers before other members are destroyed. | 451 // invalidate its weak pointers before other members are destroyed. |
| 452 base::WeakPtrFactory<GDataDirectoryService> weak_ptr_factory_; | 452 base::WeakPtrFactory<GDataDirectoryService> weak_ptr_factory_; |
| 453 | 453 |
| 454 DISALLOW_COPY_AND_ASSIGN(GDataDirectoryService); | 454 DISALLOW_COPY_AND_ASSIGN(GDataDirectoryService); |
| 455 }; | 455 }; |
| 456 | 456 |
| 457 } // namespace gdata | 457 } // namespace gdata |
| 458 | 458 |
| 459 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ | 459 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ |
| OLD | NEW |