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 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/singleton.h" | 14 #include "base/memory/singleton.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/platform_file.h" | 16 #include "base/platform_file.h" |
17 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
18 #include "chrome/browser/chromeos/gdata/gdata_params.h" | |
19 #include "chrome/browser/chromeos/gdata/gdata_uploader.h" | 18 #include "chrome/browser/chromeos/gdata/gdata_uploader.h" |
20 #include "chrome/browser/chromeos/gdata/gdata_wapi_parser.h" | 19 #include "chrome/browser/chromeos/gdata/gdata_wapi_parser.h" |
21 #include "chrome/browser/profiles/profile_keyed_service.h" | 20 #include "chrome/browser/profiles/profile_keyed_service.h" |
22 #include "chrome/browser/profiles/profile_keyed_service_factory.h" | 21 #include "chrome/browser/profiles/profile_keyed_service_factory.h" |
23 | 22 |
24 namespace base { | 23 namespace base { |
25 class SequencedTaskRunner; | 24 class SequencedTaskRunner; |
26 } | 25 } |
27 | 26 |
28 namespace gdata { | 27 namespace gdata { |
29 | 28 |
30 struct CreateDBParams; | 29 struct CreateDBParams; |
31 class GDataFile; | 30 class GDataFile; |
32 class GDataDirectory; | 31 class GDataDirectory; |
33 class GDataDirectoryService; | 32 class GDataDirectoryService; |
34 class ResourceMetadataDB; | 33 class ResourceMetadataDB; |
35 | 34 |
36 class GDataEntryProto; | 35 class GDataEntryProto; |
37 class GDataDirectoryProto; | 36 class GDataDirectoryProto; |
38 class GDataRootDirectoryProto; | 37 class GDataRootDirectoryProto; |
39 class PlatformFileInfoProto; | 38 class PlatformFileInfoProto; |
40 | 39 |
| 40 // Callback type used to get result of file search. |
| 41 // If |error| is not PLATFORM_FILE_OK, |entry| is set to NULL. |
| 42 typedef base::Callback<void(GDataFileError error, GDataEntry* entry)> |
| 43 FindEntryCallback; |
| 44 |
41 // The root directory content origin. | 45 // The root directory content origin. |
42 enum ContentOrigin { | 46 enum ContentOrigin { |
43 UNINITIALIZED, | 47 UNINITIALIZED, |
44 // Content is currently loading from somewhere. Needs to wait. | 48 // Content is currently loading from somewhere. Needs to wait. |
45 INITIALIZING, | 49 INITIALIZING, |
46 // Content is initialized, but during refreshing. | 50 // Content is initialized, but during refreshing. |
47 REFRESHING, | 51 REFRESHING, |
48 // Content is initialized from disk cache. | 52 // Content is initialized from disk cache. |
49 FROM_CACHE, | 53 FROM_CACHE, |
50 // Content is initialized from the direct server response. | 54 // Content is initialized from the direct server response. |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 // This should remain the last member so it'll be destroyed first and | 483 // This should remain the last member so it'll be destroyed first and |
480 // invalidate its weak pointers before other members are destroyed. | 484 // invalidate its weak pointers before other members are destroyed. |
481 base::WeakPtrFactory<GDataDirectoryService> weak_ptr_factory_; | 485 base::WeakPtrFactory<GDataDirectoryService> weak_ptr_factory_; |
482 | 486 |
483 DISALLOW_COPY_AND_ASSIGN(GDataDirectoryService); | 487 DISALLOW_COPY_AND_ASSIGN(GDataDirectoryService); |
484 }; | 488 }; |
485 | 489 |
486 } // namespace gdata | 490 } // namespace gdata |
487 | 491 |
488 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ | 492 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILES_H_ |
OLD | NEW |