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

Side by Side Diff: chrome/browser/chromeos/gdata/gdata_files.h

Issue 10855243: child_files_ and child_directories_ have resource_ids instead of GDataFile* and GDataDirectory*. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: rebase Created 8 years, 4 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_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 <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 // the same name "Foo" will be renames to "Foo (1)" and "Foo (2)". 245 // the same name "Foo" will be renames to "Foo (1)" and "Foo (2)".
246 // TODO(satorux): Remove this. crbug.com/139649 246 // TODO(satorux): Remove this. crbug.com/139649
247 void AddEntry(GDataEntry* entry); 247 void AddEntry(GDataEntry* entry);
248 248
249 // Removes the entry from its children list and destroys the entry instance. 249 // Removes the entry from its children list and destroys the entry instance.
250 // TODO(satorux): Remove this. crbug.com/139649 250 // TODO(satorux): Remove this. crbug.com/139649
251 void RemoveEntry(GDataEntry* entry); 251 void RemoveEntry(GDataEntry* entry);
252 252
253 // Takes over all entries from |dir|. 253 // Takes over all entries from |dir|.
254 // TODO(satorux): Remove this. crbug.com/139649 254 // TODO(satorux): Remove this. crbug.com/139649
255 bool TakeOverEntries(GDataDirectory* dir); 255 void TakeOverEntries(GDataDirectory* dir);
256 256
257 // Find a child by its name. 257 // Takes over entry represented by |resource_id|. Helper function for
258 // TODO(satorux): Remove this. crbug.com/139649 258 // TakeOverEntries. TODO(satorux): Remove this. crbug.com/139649
259 GDataEntry* FindChild(const FilePath::StringType& file_name) const; 259 void TakeOverEntry(const std::string& resource_id);
260 260
261 // Add |entry| to children. 261 // Find a child's resource_id by its name. Returns the empty string if not
262 void AddChild(GDataEntry* entry); 262 // found. TODO(satorux): Remove this. crbug.com/139649
263 std::string FindChild(const FilePath::StringType& file_name) const;
263 264
264 // Removes the entry from its children without destroying the 265 // Removes the entry from its children without destroying the
265 // entry instance. 266 // entry instance.
266 void RemoveChild(GDataEntry* entry); 267 void RemoveChild(GDataEntry* entry);
267 268
268 // Removes child elements. 269 // Removes child elements.
269 void RemoveChildren(); 270 void RemoveChildren();
270 void RemoveChildFiles(); 271 void RemoveChildFiles();
271 void RemoveChildDirectories(); 272 void RemoveChildDirectories();
272 273
273 // Recursively extracts the paths set of all sub-directories. 274 // Recursively extracts the paths set of all sub-directories.
274 void GetChildDirectoryPaths(std::set<FilePath>* child_dirs); 275 void GetChildDirectoryPaths(std::set<FilePath>* child_dirs);
275 276
276 // Maps between base_name and resource_id of files and directories. 277 // Map between base_name and resource_id of files and directories.
277 typedef std::map<FilePath::StringType, GDataFile*> GDataFileCollection; 278 typedef std::map<FilePath::StringType, std::string> GDataChildMap;
278 typedef std::map<FilePath::StringType, GDataDirectory*>
279 GDataDirectoryCollection;
280 // Collection of children. 279 // Collection of children.
281 GDataFileCollection child_files_; 280 GDataChildMap child_files_;
282 GDataDirectoryCollection child_directories_; 281 GDataChildMap child_directories_;
283 282
284 DISALLOW_COPY_AND_ASSIGN(GDataDirectory); 283 DISALLOW_COPY_AND_ASSIGN(GDataDirectory);
285 }; 284 };
286 285
287 } // namespace gdata 286 } // namespace gdata
288 287
289 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ 288 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_directory_service.cc ('k') | chrome/browser/chromeos/gdata/gdata_files.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698