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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/memory/singleton.h" | 16 #include "base/memory/singleton.h" |
17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
18 #include "base/platform_file.h" | 18 #include "base/platform_file.h" |
19 #include "base/synchronization/lock.h" | 19 #include "base/synchronization/lock.h" |
20 #include "chrome/browser/chromeos/gdata/find_entry_callback.h" | |
21 #include "chrome/browser/chromeos/gdata/gdata_params.h" | 20 #include "chrome/browser/chromeos/gdata/gdata_params.h" |
22 #include "chrome/browser/chromeos/gdata/gdata_parser.h" | 21 #include "chrome/browser/chromeos/gdata/gdata_parser.h" |
23 #include "chrome/browser/chromeos/gdata/gdata_uploader.h" | 22 #include "chrome/browser/chromeos/gdata/gdata_uploader.h" |
24 #include "chrome/browser/profiles/profile_keyed_service.h" | 23 #include "chrome/browser/profiles/profile_keyed_service.h" |
25 #include "chrome/browser/profiles/profile_keyed_service_factory.h" | 24 #include "chrome/browser/profiles/profile_keyed_service_factory.h" |
26 | 25 |
27 namespace gdata { | 26 namespace gdata { |
28 | 27 |
28 class GDataEntry; | |
29 class GDataFile; | 29 class GDataFile; |
30 class GDataDirectory; | 30 class GDataDirectory; |
31 class GDataRootDirectory; | 31 class GDataRootDirectory; |
32 | 32 |
33 class GDataEntryProto; | 33 class GDataEntryProto; |
34 class GDataFileProto; | 34 class GDataFileProto; |
35 class GDataDirectoryProto; | 35 class GDataDirectoryProto; |
36 class GDataRootDirectoryProto; | 36 class GDataRootDirectoryProto; |
37 class PlatformFileInfoProto; | 37 class PlatformFileInfoProto; |
38 | 38 |
(...skipping 18 matching lines...) Expand all Loading... | |
57 }; | 57 }; |
58 | 58 |
59 // The root directory name used for the Google Drive file system tree. The | 59 // The root directory name used for the Google Drive file system tree. The |
60 // name is used in URLs for the file manager, hence user-visible. | 60 // name is used in URLs for the file manager, hence user-visible. |
61 const FilePath::CharType kGDataRootDirectory[] = FILE_PATH_LITERAL("drive"); | 61 const FilePath::CharType kGDataRootDirectory[] = FILE_PATH_LITERAL("drive"); |
62 | 62 |
63 // The resource ID for the root directory is defined in the spec: | 63 // The resource ID for the root directory is defined in the spec: |
64 // https://developers.google.com/google-apps/documents-list/ | 64 // https://developers.google.com/google-apps/documents-list/ |
65 const char kGDataRootDirectoryResourceId[] = "folder:root"; | 65 const char kGDataRootDirectoryResourceId[] = "folder:root"; |
66 | 66 |
67 // Used to get result of file search. | |
68 // If |error| is not PLATFORM_FILE_OK, |entry| is set to NULL. | |
69 typedef base::Callback<void(base::PlatformFileError error, GDataEntry* entry)> | |
70 FindEntryCallback; | |
71 | |
72 // Callback used to find a directory element for file system updates. | |
73 void ReadOnlyFindEntryCallback(GDataEntry** out, | |
hashimoto
2012/06/11 09:44:34
This function looks only used by GDataFileSystem::
hshi1
2012/06/11 17:48:53
I'm moving this to gdata_file_system.cc, but it ne
achuithb
2012/06/11 20:46:37
I'm not sure why you got rid of find_entry_callbac
hshi1
2012/06/11 20:58:51
IMHO the definition of FindEntryCallback type and
achuithb
2012/06/11 21:48:41
Yes, but the new locations for FindEntryCallback a
achuithb
2012/06/12 07:59:47
This didn't get addressed. gdata_params.h was desi
| |
74 base::PlatformFileError error, | |
75 GDataEntry* entry); | |
76 | |
67 // Base class for representing files and directories in gdata virtual file | 77 // Base class for representing files and directories in gdata virtual file |
68 // system. | 78 // system. |
69 class GDataEntry { | 79 class GDataEntry { |
70 public: | 80 public: |
71 explicit GDataEntry(GDataDirectory* parent, GDataRootDirectory* root); | 81 explicit GDataEntry(GDataDirectory* parent, GDataRootDirectory* root); |
72 virtual ~GDataEntry(); | 82 virtual ~GDataEntry(); |
73 | 83 |
74 virtual GDataFile* AsGDataFile(); | 84 virtual GDataFile* AsGDataFile(); |
75 virtual GDataDirectory* AsGDataDirectory(); | 85 virtual GDataDirectory* AsGDataDirectory(); |
76 virtual GDataRootDirectory* AsGDataRootDirectory(); | 86 virtual GDataRootDirectory* AsGDataRootDirectory(); |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
424 base::Time last_serialized_; | 434 base::Time last_serialized_; |
425 int largest_changestamp_; | 435 int largest_changestamp_; |
426 size_t serialized_size_; | 436 size_t serialized_size_; |
427 | 437 |
428 DISALLOW_COPY_AND_ASSIGN(GDataRootDirectory); | 438 DISALLOW_COPY_AND_ASSIGN(GDataRootDirectory); |
429 }; | 439 }; |
430 | 440 |
431 } // namespace gdata | 441 } // namespace gdata |
432 | 442 |
433 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ | 443 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ |
OLD | NEW |