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 #include "chrome/browser/sync_file_system/sync_file_system_service.h" | 5 #include "chrome/browser/sync_file_system/sync_file_system_service.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "chrome/browser/extensions/api/sync_file_system/extension_sync_event_ob
server.h" | 13 #include "chrome/browser/extensions/api/sync_file_system/extension_sync_event_ob
server.h" |
14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/browser/sync/profile_sync_service.h" | 15 #include "chrome/browser/sync/profile_sync_service.h" |
16 #include "chrome/browser/sync/profile_sync_service_factory.h" | 16 #include "chrome/browser/sync/profile_sync_service_factory.h" |
17 #include "chrome/browser/sync_file_system/drive_file_sync_service.h" | 17 #include "chrome/browser/sync_file_system/drive_file_sync_service.h" |
18 #include "chrome/browser/sync_file_system/local_file_sync_service.h" | 18 #include "chrome/browser/sync_file_system/local_file_sync_service.h" |
19 #include "chrome/browser/sync_file_system/logger.h" | 19 #include "chrome/browser/sync_file_system/logger.h" |
20 #include "chrome/browser/sync_file_system/sync_event_observer.h" | 20 #include "chrome/browser/sync_file_system/sync_event_observer.h" |
21 #include "chrome/common/chrome_notification_types.h" | 21 #include "chrome/common/chrome_notification_types.h" |
22 #include "chrome/common/extensions/extension.h" | 22 #include "chrome/common/extensions/extension.h" |
23 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" | 23 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
24 #include "content/public/browser/browser_thread.h" | 24 #include "content/public/browser/browser_thread.h" |
25 #include "content/public/browser/notification_details.h" | 25 #include "content/public/browser/notification_details.h" |
26 #include "content/public/browser/notification_service.h" | 26 #include "content/public/browser/notification_service.h" |
27 #include "googleurl/src/gurl.h" | 27 #include "googleurl/src/gurl.h" |
28 #include "webkit/browser/fileapi/file_system_context.h" | 28 #include "webkit/browser/fileapi/file_system_context.h" |
29 #include "webkit/fileapi/syncable/sync_direction.h" | 29 #include "webkit/browser/fileapi/syncable/sync_direction.h" |
30 #include "webkit/fileapi/syncable/sync_file_metadata.h" | 30 #include "webkit/browser/fileapi/syncable/sync_file_metadata.h" |
31 #include "webkit/fileapi/syncable/sync_status_code.h" | 31 #include "webkit/browser/fileapi/syncable/sync_status_code.h" |
32 | 32 |
33 using content::BrowserThread; | 33 using content::BrowserThread; |
34 using fileapi::FileSystemURL; | 34 using fileapi::FileSystemURL; |
35 using fileapi::FileSystemURLSet; | 35 using fileapi::FileSystemURLSet; |
36 | 36 |
37 namespace sync_file_system { | 37 namespace sync_file_system { |
38 | 38 |
39 namespace { | 39 namespace { |
40 | 40 |
41 const int64 kRetryTimerIntervalInSeconds = 20 * 60; // 20 min. | 41 const int64 kRetryTimerIntervalInSeconds = 20 * 60; // 20 min. |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 syncer::APPS); | 568 syncer::APPS); |
569 remote_file_service_->SetSyncEnabled(sync_enabled_); | 569 remote_file_service_->SetSyncEnabled(sync_enabled_); |
570 if (sync_enabled_) { | 570 if (sync_enabled_) { |
571 base::MessageLoopProxy::current()->PostTask( | 571 base::MessageLoopProxy::current()->PostTask( |
572 FROM_HERE, base::Bind(&SyncFileSystemService::MaybeStartSync, | 572 FROM_HERE, base::Bind(&SyncFileSystemService::MaybeStartSync, |
573 AsWeakPtr())); | 573 AsWeakPtr())); |
574 } | 574 } |
575 } | 575 } |
576 | 576 |
577 } // namespace sync_file_system | 577 } // namespace sync_file_system |
OLD | NEW |